fix(hash-text): added missing toString()

This commit is contained in:
Corentin Thomasset 2022-04-04 00:39:20 +02:00
parent 0f3b7445ad
commit 4ca5fce911
No known key found for this signature in database
GPG key ID: DBD997E935996158

View file

@ -17,7 +17,7 @@
<br /> <br />
<n-input <n-input
style="text-align: center;" style="text-align: center;"
v-model:value="hashedText" :value="hashedText"
type="textarea" type="textarea"
placeholder="Your string hash" placeholder="Your string hash"
:autosize="{ minRows: 1 }" :autosize="{ minRows: 1 }"
@ -61,9 +61,9 @@ const algos = {
RIPEMD160, RIPEMD160,
} as const; } as const;
const clearText = ref('Lorem ipsum') const clearText = ref('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lacus metus blandit dolor lacus natoque ad fusce aliquam velit.')
const hashedText = computed(() => algos[algo.value](clearText.value))
const algo = ref<keyof typeof algos>('SHA256') const algo = ref<keyof typeof algos>('SHA256')
const hashedText = computed(() => algos[algo.value](clearText.value).toString())
const { copy } = useCopy({ source: hashedText, text: 'Token copied to the clipboard' }) const { copy } = useCopy({ source: hashedText, text: 'Token copied to the clipboard' })
</script> </script>