js-waku/src/lib/enr/create.ts
2022-02-16 12:11:54 +11:00

11 lines
254 B
TypeScript

import { bytesToHex } from "../utils";
import { NodeId } from "./types";
export function createNodeId(bytes: Uint8Array): NodeId {
if (bytes.length !== 32) {
throw new Error("NodeId must be 32 bytes in length");
}
return bytesToHex(bytes);
}