Skip to content

Instantly share code, notes, and snippets.

@christophersjchow
Created March 18, 2019 00:26
Show Gist options
  • Save christophersjchow/b4b687f332e8e228524132f76b566f1b to your computer and use it in GitHub Desktop.
Save christophersjchow/b4b687f332e8e228524132f76b566f1b to your computer and use it in GitHub Desktop.
var crypto = require('crypto');
var base64url = require('base64url');
/** Sync */
function randomStringAsBase64Url(size) {
return base64url(crypto.randomBytes(size));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment