提交 c09d7c97 编写于 作者: B baiy 提交者: ninecents

update

上级 96c5e6d2
......@@ -43,7 +43,7 @@ npm run build -adapter=[chrome|edge|utools|firefox|web]
| 功能 | 说明 |离线使用|
|--------------|-------------------------------------------------------------------------------------------------------------------------------|---|
| 哈希 | `md5`, `sha1`, `sha256`, `sha512`,`sm3` |√|
| 加密/解密 | `AES`,`DES`,`RC4`,`Rabbit`,`TripleDes`,`sm2` |√|
| 加密/解密 | `AES`,`DES`,`RC4`,`Rabbit`,`TripleDes`,`sm2`,`sm4` |√|
| BASE64编码 | `加密`,`解密`,`支持文件` |√|
| URL编码 | `编码`,`解码` |√|
| 时间戳 | `双向转换`,`毫秒` |√|
......@@ -68,6 +68,7 @@ npm run build -adapter=[chrome|edge|utools|firefox|web]
| 变量名格式转换 | `Var Name`, `var-name`, `VAR_NAME`, `VarName`, `varName`, `var_name`, `var name` |√|
| jwt解码 | `header`, `payload` |√|
| Hex/String转换 | `hex to string`, `string to hex`, `十六进制转字符串`, `字符串转十六进制` |√|
| Hex/Base64转换 | `hex to Base64`, `Base64 to hex` |√|
| 文本处理 | `大小写转换`, `中英文标点转换`, `简繁转换`, `替换`, `字符统计`, `行去重`, `添加行号`, `行排序`, `过滤行首尾不可见字符`,`过滤空行` |√|
| html编码 | - |√|
| 原码/反码/补码 | `生成` |√|
......
此差异已折叠。
{
"name": "c-tool",
"version": "1.11.1",
"version": "1.11.2",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --port 8081",
......
......@@ -19,6 +19,7 @@
import CryptoJS from "crypto-js"
import heightResize from "./components/heightResize";
import autoHeightTextarea from "./components/autoHeightTextarea";
import {Base64} from 'js-base64'
export default {
components: {
......@@ -31,22 +32,29 @@ export default {
methods: {
handle(type) {
if (this.current.input) {
switch (type) {
case "hex":
this.current.output = CryptoJS.enc.Hex.stringify(CryptoJS.enc.Base64.parse(this.current.input));
break;
case "base64":
this.current.output = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(this.current.input));
break;
default:
return;
try {
switch (type) {
case "hex":
if (!Base64.isValid(this.current.input)){
throw new Error("input base64 string invalid")
}
this.current.output = CryptoJS.enc.Hex.stringify(CryptoJS.enc.Base64.parse(this.current.input));
break;
case "base64":
this.current.output = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(this.current.input));
break;
default:
return;
}
if (this.current.isUppercase && type === "hex") {
this.current.output = this.current.output.toUpperCase()
}
this.current.operation = type;
this.$clipboardCopy(this.current.output);
this.$saveToolData(this.current);
}catch (e) {
this.$Message.error(e.message)
}
if (this.current.isUppercase && type === "hex") {
this.current.output = this.current.output.toUpperCase()
}
this.current.operation = type;
this.$clipboardCopy(this.current.output);
this.$saveToolData(this.current);
}
},
resize(height) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册