mirror of https://github.com/waku-org/js-waku.git
Remove unused code
This commit is contained in:
parent
17c8335d6f
commit
5e1cd78288
|
@ -32,16 +32,9 @@ export function verify(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createNodeId(bytes: Uint8Array): NodeId {
|
|
||||||
if (bytes.length !== 32) {
|
|
||||||
throw new Error("NodeId must be 32 bytes in length");
|
|
||||||
}
|
|
||||||
return bytesToHex(bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function nodeId(pubKey: Uint8Array): NodeId {
|
export function nodeId(pubKey: Uint8Array): NodeId {
|
||||||
const publicKey = secp.Point.fromHex(pubKey);
|
const publicKey = secp.Point.fromHex(pubKey);
|
||||||
const uncompressedPubkey = publicKey.toRawBytes(false);
|
const uncompressedPubkey = publicKey.toRawBytes(false);
|
||||||
|
|
||||||
return createNodeId(keccak256(uncompressedPubkey.slice(1)));
|
return bytesToHex(keccak256(uncompressedPubkey.slice(1)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue