Created
September 10, 2021 15:43
-
-
Save PaulRBerg/043ac2b2d367815d72293c6687a838b8 to your computer and use it in GitHub Desktop.
Random bytes32 generator written in TypeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function getRandomBytes32(): string { | |
const length: number = 64; | |
const array: number[] = [...Array(length)]; | |
const number: string = array.map(() => Math.floor(Math.random() * 16).toString(16)).join(""); | |
return "0x" + number; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment