mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-31 03:54:20 +01:00
Faster lookup of bip39 words
This commit is contained in:
committed by
benthecarman
parent
24a4ea5a4d
commit
ae7c03114e
@@ -41,8 +41,8 @@ const initialValues: SeedWordsForm = {
|
||||
};
|
||||
|
||||
function validateWord(word?: string): boolean {
|
||||
// return word?.trim() === "bacon";
|
||||
return WORDS_EN.includes(word?.trim() ?? "");
|
||||
const trimmed = word?.trim();
|
||||
return trimmed ? WORDS_EN.has(trimmed) : false;
|
||||
}
|
||||
|
||||
function SeedTextField(props: TextFieldProps) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const WORDS_EN = [
|
||||
export const WORDS_EN: Set<string> = new Set([
|
||||
"abandon",
|
||||
"ability",
|
||||
"able",
|
||||
@@ -2047,4 +2047,4 @@ export const WORDS_EN = [
|
||||
"zero",
|
||||
"zone",
|
||||
"zoo"
|
||||
];
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user