This repository has been archived on 2023-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
chainsafe-bls/test/util.ts

8 lines
228 B
TypeScript
Raw Normal View History

2020-11-13 21:43:20 +00:00
export function fromHexString(hex: string): Buffer {
return Buffer.from(hex.replace("0x", ""), "hex");
}
export function toHexString(bytes: Buffer | Uint8Array): string {
return `0x${Buffer.from(bytes).toString("hex")}`;
}