mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-11 19:44:21 +00:00
174dea8a29
* Add better password checking, confirm password, feedback, and up the minimum to 12. * Move wallet generation off to a web worker, and bump up the n value to 8192. Refactor workers a wee bit. * tscheck cleanup * Make keystore password a form. Replace text with spinner on load. * Center align again. * Hard code n factor of test wallet, fix some misspelled type definitions for IV3Wallet.
19 lines
503 B
TypeScript
19 lines
503 B
TypeScript
import { fromV3, IFullWallet } from 'ethereumjs-wallet';
|
|
|
|
const worker: Worker = self as any;
|
|
interface DecryptionParameters {
|
|
keystore: string;
|
|
password: string;
|
|
nonStrict: boolean;
|
|
}
|
|
|
|
worker.onmessage = (event: MessageEvent) => {
|
|
const info: DecryptionParameters = event.data;
|
|
try {
|
|
const rawKeystore: IFullWallet = fromV3(info.keystore, info.password, info.nonStrict);
|
|
worker.postMessage(rawKeystore.getPrivateKeyString());
|
|
} catch (e) {
|
|
worker.postMessage(e.message);
|
|
}
|
|
};
|