Skip to content

Instantly share code, notes, and snippets.

@Pengeszikra
Created April 28, 2016 08:45
Show Gist options
  • Select an option

  • Save Pengeszikra/9dcba0ac9d33e0dcab16776454648732 to your computer and use it in GitHub Desktop.

Select an option

Save Pengeszikra/9dcba0ac9d33e0dcab16776454648732 to your computer and use it in GitHub Desktop.
five digit random radix32 ID ES6
/* five digit random radix32 ID */
function GUID32(){ return ('0'.repeat(5)+( ~~(Math.random() * parseInt( 10e4 , 32 )) ).toString(32).toUpperCase()).slice( -5 ) };
@Pengeszikra
Copy link
Author

Base64 random string generator without pattern

btoa(Math.random()).slice(3,-2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment