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

#60 添加 hex string 转换

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