Skip to content

Instantly share code, notes, and snippets.

View faazshift's full-sized avatar

Brendan Warkentin faazshift

  • West Valley City, UT
View GitHub Profile
@faazshift
faazshift / UniqueId.md
Created July 30, 2018 20:51
Small, portable and suitably unique random ID functions for typical web application use

Each of the functions in this Gist use a system provided source of cryptographically secure random bytes. Typical, built-in random number functions are weak and unreliable for true randomness. These functions are small, dependency-free and fairly portable across different language versions and environments. They have each been tested repeatedly over many millions of iterations.