UNPKG

184 BJavaScriptView Raw
1const crypto = require('crypto')
2
3module.exports = function hash (data) {
4 const shasum = crypto.createHash('sha1')
5 shasum.update(data)
6 return shasum.digest('hex').substr(0, 8)
7}