Skip to content

Instantly share code, notes, and snippets.

@rawnly
Created January 11, 2021 09:32
Show Gist options
  • Save rawnly/419a156dcc8c250d3c231f7dc2df8819 to your computer and use it in GitHub Desktop.
Save rawnly/419a156dcc8c250d3c231f7dc2df8819 to your computer and use it in GitHub Desktop.
const generateRandomString = (length: number): string =>
`1${"0".repeat(length)}`.replace(/[01]/g, () => (0 | (Math.random() * 16)).toString(16))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment