UNPKG

lasso

Version:

Lasso.js is a build tool and runtime library for building and bundling all of the resources needed by a web application

13 lines (9 loc) 270 B
const crypto = require('crypto'); exports.HASH_OVERFLOW_LENGTH = 8; exports.generate = function (str, len) { let hash = crypto.createHash('sha1') .update(str) .digest('hex'); if (len != null) hash = hash.substring(0, len); return hash; };