Skip to content

Instantly share code, notes, and snippets.

@eligrey
Last active December 14, 2015 05:29
Show Gist options
  • Save eligrey/5035957 to your computer and use it in GitHub Desktop.
Save eligrey/5035957 to your computer and use it in GitHub Desktop.
function hex_ipsum(bytes, spaces) {
var b = new Uint8Array(bytes);
crypto.getRandomValues(b);
return Array.prototype.map.call(b, function(n) {
return ("0"+n.toString(16)).slice(-2);
}).join(spaces ? " " : "").toUpperCase();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment