mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-26 01:36:15 -04:00
feat(tool): bip39-generator
This commit is contained in:
parent
390ef93232
commit
765c010700
7 changed files with 436 additions and 29 deletions
47
src/tools/bip39-generator/bip39-generator.vue
Normal file
47
src/tools/bip39-generator/bip39-generator.vue
Normal 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>
|
11
src/tools/bip39-generator/index.ts
Normal file
11
src/tools/bip39-generator/index.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { AlignJustified } from '@vicons/tabler';
|
||||
import type { ITool } from '../Tool';
|
||||
|
||||
export const tool: ITool = {
|
||||
name: 'BIP39 passphrase generator',
|
||||
path: '/bip39-generator',
|
||||
description: 'Generate BIP39 passphrase from existing or random mnemonic, or get the mnemonic from the passphrase.',
|
||||
keywords: ['BIP39', 'passphrase', 'generator', 'mnemonic', 'entropy'],
|
||||
component: () => import('./bip39-generator.vue'),
|
||||
icon: AlignJustified,
|
||||
};
|
|
@ -6,12 +6,13 @@ import { tool as hashText } from './hash-text';
|
|||
import { tool as uuidGenerator } from './uuid-generator';
|
||||
import { tool as romanNumeralConverter } from './roman-numeral-converter';
|
||||
import { tool as cypher } from './encryption';
|
||||
import { tool as bip39 } from './bip39-generator';
|
||||
|
||||
export const toolsByCategory: ToolCategory[] = [
|
||||
{
|
||||
name: 'Crypto',
|
||||
icon: LockOpen,
|
||||
components: [tokenGenerator, hashText, uuidGenerator, cypher],
|
||||
components: [tokenGenerator, hashText, uuidGenerator, cypher, bip39],
|
||||
},
|
||||
{
|
||||
name: 'Converter',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue