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

#60 添加 hex string 转换

上级 2fa9f773
......@@ -40,7 +40,7 @@ npm run serve -adapter=utools
|---|---|---|
|哈希|`md5`, `sha1`, `sha256`, `sha512`,`sm3`|√|
|加密/解密|`AES`,`DES`,`RC4`,`Rabbit`,`TripleDes`,`sm2`|√|
|BASE64编码|`加密`,`解密`|√|
|BASE64编码|`加密`,`解密`,`支持文件`|√|
|URL编码|`编码`,`解码`|√|
|时间戳|双向转换|√|
|二维码|`生成`,`解析`|√|
......@@ -63,6 +63,7 @@ npm run serve -adapter=utools
|ascii编码转换|`十进制`, `十六进制`, `八进制`, `二进制`, `字符串`|√|
|变量名格式转换|`Var Name`, `var-name`, `VAR_NAME`, `VarName`, `varName`, `var_name`, `var name`|√|
|jwt解码|`header`, `payload`|√|
|Hex/String转换|`hex to string`, `string to hex`, `十六进制转字符串`, `字符串转十六进制`|√|
## 第三方开源库
项目诞生离不开这些优秀的开源程序
......
{
"name": "c-tool",
"version": "1.6.4",
"version": "1.6.5",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --port 8081",
......
......@@ -40,6 +40,7 @@ const tool = [
{'name': 'ascii', 'title': 'ascii转换', 'cat': ['conversion']},
{'name': 'variableConversion', 'title': '变量名转换', 'cat': ['conversion']},
{'name': 'jwt', 'title': 'jwt解码', 'cat': ['conversion']},
{'name': 'hexString', 'title': 'Hex/String转换', 'cat': ['conversion']},
]
// 工具类功能配置
......@@ -54,7 +55,8 @@ const utools = {
keyword: {
hash: ['md5', 'sha1', 'sha256', 'sha512', 'sm3'],
encrypt: ['AES', 'DES', 'RC4', 'Rabbit', 'TripleDes', 'sm2'],
jwt: ['jwtDecode']
jwt: ['jwtDecode'],
hexString: ['hex to string', 'string to hex', '十六进制转字符串', '字符串转十六机制'],
},
cmds: {
timestamp: [
......@@ -71,14 +73,14 @@ const utools = {
"type": "regex",
"match": "/[a-zA-z]+://[^\\s]*/i",
"minLength": 8,
"feature":'generate' // 适配工具内功能
"feature": 'generate' // 适配工具内功能
},
{
"type": "regex",
"match": "/[a-zA-z]+://[^\\s]*/i",
"minLength": 8,
"feature":'reader' // 适配工具内功能
"feature": 'reader' // 适配工具内功能
}
],
ip: [
......
......@@ -105,6 +105,10 @@ const routes = [
{
path: '/tool/jwt',
component: r => require(['./views/tool/jwt.vue'], r)
},
{
path: '/tool/hexString',
component: r => require(['./views/tool/hexString.vue'], r)
}
]
......
<template>
<heightResize ignore :append="['.page-option-block']" @resize="resize">
<autoHeightTextarea v-model="current.input" :height="inputHeight" :placeholder="$t('hexString_input')"/>
<option-block class="page-option-block">
<div>
<Input v-model="current.input" :rows="7" type="textarea" placeholder="内容"></Input>
<option-block>
<FormItem>
<ButtonGroup>
<Button type="primary" @click="handle('hex')">String -> Hex</Button>
......@@ -9,23 +9,17 @@
</ButtonGroup>
</FormItem>
<FormItem>
<Checkbox v-model="current.isUppercase">{{ $t('hexString_uppercase') }}</Checkbox>
<Checkbox v-model="current.isUppercase">大写字母</Checkbox>
</FormItem>
</option-block>
<autoHeightTextarea :value="current.output" :height="outputHeight" :placeholder="$t('hexString_output')"/>
</heightResize>
<Input v-model="current.output" :rows="7" type="textarea" placeholder="结果"></Input>
</div>
</template>
<script>
import heightResize from "./components/heightResize";
import autoHeightTextarea from "./components/autoHeightTextarea";
export default {
components: {
heightResize,
autoHeightTextarea
},
created() {
this.$initToolData('input')
this.current = Object.assign(this.current, this.$getToolData("input"))
},
methods: {
handle(type) {
......@@ -48,10 +42,6 @@ export default {
this.$clipboardCopy(this.current.output);
this.$saveToolData(this.current);
}
},
resize(height) {
this.inputHeight = Math.min(160, Math.ceil(height / 2))
this.outputHeight = height - this.inputHeight
}
},
data() {
......@@ -61,10 +51,8 @@ export default {
isUppercase: false,
output: "",
operation: ""
},
inputHeight: 100,
outputHeight: 100
}
}
},
}
</script>
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册