Skip to content

Instantly share code, notes, and snippets.

@PaulRBerg
Last active September 2, 2021 20:07
Show Gist options
  • Save PaulRBerg/b979bd1041df93ccd26d2906bf9dba2b to your computer and use it in GitHub Desktop.
Save PaulRBerg/b979bd1041df93ccd26d2906bf9dba2b to your computer and use it in GitHub Desktop.
Random Ethereum address generator written in TypeScript
export function getRandomEthereumAddress(): string {
const length: number = 40;
const number: string = [...Array(length)]
.map(() => {
return 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