mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-02-25 07:55:55 +08:00
fix(bip39-generator): cleared an issue with the mnemonic validation
This commit is contained in:
parent
e48d60b1ed
commit
ca7cb44389
1 changed files with 7 additions and 7 deletions
|
@ -59,24 +59,24 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useCopy } from '@/composable/copy';
|
import { useCopy } from '@/composable/copy';
|
||||||
import { ref, computed } from 'vue';
|
import { useValidation } from '@/composable/validation';
|
||||||
import {
|
import {
|
||||||
entropyToMnemonic,
|
|
||||||
englishWordList,
|
|
||||||
chineseSimplifiedWordList,
|
chineseSimplifiedWordList,
|
||||||
chineseTraditionalWordList,
|
chineseTraditionalWordList,
|
||||||
czechWordList,
|
czechWordList,
|
||||||
|
englishWordList,
|
||||||
|
entropyToMnemonic,
|
||||||
frenchWordList,
|
frenchWordList,
|
||||||
|
generateEntropy,
|
||||||
italianWordList,
|
italianWordList,
|
||||||
japaneseWordList,
|
japaneseWordList,
|
||||||
koreanWordList,
|
koreanWordList,
|
||||||
|
mnemonicToEntropy,
|
||||||
portugueseWordList,
|
portugueseWordList,
|
||||||
spanishWordList,
|
spanishWordList,
|
||||||
generateEntropy,
|
|
||||||
mnemonicToEntropy,
|
|
||||||
} from '@it-tools/bip39';
|
} from '@it-tools/bip39';
|
||||||
import { Copy, Refresh } from '@vicons/tabler';
|
import { Copy, Refresh } from '@vicons/tabler';
|
||||||
import { useValidation } from '@/composable/validation';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
const languages = {
|
const languages = {
|
||||||
English: englishWordList,
|
English: englishWordList,
|
||||||
|
@ -134,7 +134,7 @@ const mnemonicValidation = useValidation({
|
||||||
{
|
{
|
||||||
validator: (value) => {
|
validator: (value) => {
|
||||||
try {
|
try {
|
||||||
mnemonicToEntropy(value);
|
mnemonicToEntropy(value, languages[language.value]);
|
||||||
return true;
|
return true;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue