Code coverage report for docpress-base/lib/hash.js

Statements: 100% (5 / 5)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (5 / 5)      Ignored: none     

All files » docpress-base/lib/ » hash.js
1 2 3 4 5 6 7 81   1 4 4 4    
const crypto = require('crypto')
 
module.exports = function hash (data) {
  const shasum = crypto.createHash('sha1')
  shasum.update(data)
  return shasum.digest('hex').substr(0, 8)
}