Home Manual Reference Source Test Repository

lib/checksum.js

  1. import crypto from 'crypto';
  2.  
  3. /**
  4. * Create checksum hash of input.
  5. * @example
  6. * '50de70409f11f87b430f248daaa94d67'
  7. * @param {string} input Input to hash.
  8. * @return {string}
  9. */
  10. export default function createChecksum(input) {
  11. return crypto
  12. .createHash('md5')
  13. .update(input, 'utf8')
  14. .digest('hex');
  15. }