Skip to content

Instantly share code, notes, and snippets.

@johnmurch
Created February 23, 2016 16:27
Show Gist options
  • Save johnmurch/1c6583f9348244550f4f to your computer and use it in GitHub Desktop.
Save johnmurch/1c6583f9348244550f4f to your computer and use it in GitHub Desktop.
Generate SessionId
var crypto = require('crypto');
var generate_key = function() {
var sha = crypto.createHash('sha256');
sha.update(Math.random().toString());
return sha.digest('hex');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment