URL and cookie safe UIDs
Create cryptographically secure UIDs safe for both cookie and URL usage.
This is in contrast to modules such as rand-token
and uid2 whose UIDs are actually skewed
due to the use of
% and unnecessarily truncate the UID.
Use this if you could still use UIDs with
_ in them.
$ npm install uid-safe
var uid =
Asynchronously create a UID with a specific byte length. Because
encoding is used underneath, this is not the string length. For example,
to create a UID of length 24, you want a byte length of 18.
Asynchronously create a UID with a specific byte length and return a
Note: To use promises in Node.js prior to 0.12, promises must be
global.Promise = require('bluebird').
A synchronous version of above.
var string = uid