Node.js examples for Security:GUID
Return a unique identifier with the given `len`.
/*//from w ww . j a va 2 s . c om * * utils.uid(10); * // => "FDaS435D2z" * * @param {Number} len * @return {String} * @api private */ module.exports = function(len) { var buf = [], chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', charlen = chars.length; for (var i = 0; i < len; ++i) { buf.push(chars[getRandomInt(0, charlen - 1)]); } return buf.join(''); };