Skip to content

Instantly share code, notes, and snippets.

@0xjjpa
Last active April 26, 2024 23:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xjjpa/9527c4ddd9beeba71dee75dea8b37957 to your computer and use it in GitHub Desktop.
Save 0xjjpa/9527c4ddd9beeba71dee75dea8b37957 to your computer and use it in GitHub Desktop.
One-liner for generating 32-bytes keys
((_=>_.reduce((a, v)=>`${v.toString(16).padStart(2,"0")}${a}`,""))((_=>crypto.getRandomValues(_))(new Uint8Array(32))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment