feat(tool): bip39-generator

This commit is contained in:
Corentin Thomasset 2022-04-09 15:17:59 +02:00
parent 390ef93232
commit 765c010700
No known key found for this signature in database
GPG key ID: 3103EB5E79496F9C
7 changed files with 436 additions and 29 deletions

View file

@ -0,0 +1,47 @@
<template>
<div>
<n-card>
<n-space item-style="flex: 1 1 0">
<n-form-item label="Language:">
<n-select v-model:value="language" :options="languages" />
</n-form-item>
<n-form-item label="Entropy (seed):">
<n-input v-model:value="entropy" placeholder="Your string..." />
</n-form-item>
</n-space>
<n-form-item label="Passphrase (mnemonic):">
<n-input
style="text-align: center;"
:value="passphrase"
type="textarea"
placeholder="Your string hash"
:autosize="{ minRows: 1 }"
readonly
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
/>
</n-form-item>
</n-card>
</div>
</template>
<script setup lang="ts">
import { useCopy } from '@/composable/copy';
import { ref, computed } from 'vue'
import { entropyToMnemonic } from 'bip39'
const entropy = ref('1d60683972011cb97322ed6ae96225f3')
const language = ref('English')
const languages = ref(['English'])
const passphrase = computed(() => {
// setDefaultWordlist(language.value)
return entropyToMnemonic(Buffer.from(entropy.value, "utf-8"))
})
</script>
<style lang="scss" scoped>
</style>