lib/advanced_structures/Lock.js
function(callback) {
    crypto.randomBytes(16, function(err, buffer) {
        if (err) {
            return callback(err);
        }

        return callback(null, buffer.toString('base64'));
    });
}
function(callback) {
    crypto.randomBytes(16, function(err, buffer) {
        if (err) {
            return callback(err);
        }

        return callback(null, buffer.toString('base64'));
    });
}
function ( callback ) { crypto . randomBytes ( 16 , function ( err , buffer ) { if ( err ) { return callback ( err ) ; } return callback ( null , buffer . toString ( 'base64' ) ) ; } ) ; }
Generate a random lock token.

@param   {Function}  callback        Invoked with the token when complete
@param   {Error}     callback.err    An error that occurred, if any
@param   {string}    callback.token  The randomly generated token
@api private
Generate a random lock token .