Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get address() {
if (!this._address) {
this._address = keccak256.array(this.keypair.getPublic().encode('', false).slice(1)).slice(12, 32);
}
return "0x" + hash.utils.toHex(this._address);
}
export function fromPhrase(phrase) {
let seed = keccak256.array(phrase);
let kp;
for (let i = 0; i <= 16384 || !toAddress(kp = ec.keyFromPrivate(seed)).startsWith('00'); ++i)
seed = keccak256.array(seed);
return kp;
}
export function fromPhrase(phrase) {
let seed = keccak256.array(phrase);
let kp;
for (let i = 0; i <= 16384 || !toAddress(kp = ec.keyFromPrivate(seed)).startsWith('00'); ++i)
seed = keccak256.array(seed);
return kp;
}