Skip to content

Instantly share code, notes, and snippets.

@andreasvirkus
Created October 18, 2018 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreasvirkus/511123f3fd52d135b149966a2a7ca9a9 to your computer and use it in GitHub Desktop.
Save andreasvirkus/511123f3fd52d135b149966a2a7ca9a9 to your computer and use it in GitHub Desktop.
// Generates a small hash (useful for CSRF state params, mocking a token in localStorage for development, etc.)
export const generateHash = str => '_' + Math.random().toString(36).substr(2, 9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment