提交 8eafccbf 编写于 作者: B baiy 提交者: ninecents

hash 语言包

上级 a851e776
{
"content": "Content",
"uppercase": "Uppercase",
}
{
"content": "内容",
"uppercase": "大写字母",
}
......@@ -2,9 +2,9 @@
<div id="tool-hash">
<Row :gutter="10">
<Col span="8">
<input-block text="内容">
<Input v-model="current.input" :rows="18" type="textarea" placeholder="内容"></Input>
<Checkbox slot="extra" v-model="current.isUppercase">大写字母</Checkbox>
<input-block :text="$t('hash_content')">
<Input v-model="current.input" :rows="18" type="textarea" :placeholder="$t('hash_content')"></Input>
<Checkbox slot="extra" v-model="current.isUppercase">{{ $t('hash_uppercase') }}</Checkbox>
</input-block>
</Col>
<Col span="16">
......@@ -25,37 +25,22 @@ export default {
},
computed: {
md5() {
if (!this.current.input) {
return "";
}
let result = crypto.MD5(this.current.input).toString();
return this.current.isUppercase ? result.toUpperCase() : result;
},
sha1() {
if (!this.current.input) {
return "";
}
let result = crypto.SHA1(this.current.input).toString();
return this.current.isUppercase ? result.toUpperCase() : result;
},
sha256() {
if (!this.current.input) {
return "";
}
let result = crypto.SHA256(this.current.input).toString();
return this.current.isUppercase ? result.toUpperCase() : result;
},
sha512() {
if (!this.current.input) {
return "";
}
let result = crypto.SHA512(this.current.input).toString();
return this.current.isUppercase ? result.toUpperCase() : result;
},
sm3() {
if (!this.current.input) {
return "";
}
let result = sm.sm3(this.current.input);
return this.current.isUppercase ? result.toUpperCase() : result;
},
......@@ -63,13 +48,18 @@ export default {
watch: {
current: {
handler() {
this.$saveToolData(this.current);
if (this.current.input){
this.$saveToolData(this.current);
}
},
deep: true
}
},
methods:{
result(type){
if (!this.current.input) {
return "";
}
return this[type]
},
copy(type){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册