index.js
function hash (str) {
  return crypto
    .createHash('sha1')
    .update(str, 'ascii')
    .digest('base64')
    .replace(PLUS_GLOBAL_REGEXP, '-')
    .replace(SLASH_GLOBAL_REGEXP, '_')
    .replace(EQUAL_GLOBAL_REGEXP, '')
}
function hash (str) {
  return crypto
    .createHash('sha1')
    .update(str, 'ascii')
    .digest('base64')
    .replace(PLUS_GLOBAL_REGEXP, '-')
    .replace(SLASH_GLOBAL_REGEXP, '_')
    .replace(EQUAL_GLOBAL_REGEXP, '')
}
function hash ( str ) { return crypto . createHash ( 'sha1' ) . update ( str , 'ascii' ) . digest ( 'base64' ) . replace ( PLUS_GLOBAL_REGEXP , '-' ) . replace ( SLASH_GLOBAL_REGEXP , '_' ) . replace ( EQUAL_GLOBAL_REGEXP , '' ) }
Hash a string with SHA1, returning url-safe base64
@param {string} str
@private
Hash a string with SHA1 returning url - safe base64