get-string-hash.js 353 B

12345678910111213141516
  1. "use strict";
  2. /*
  3. Copyright 2018 Google LLC
  4. Use of this source code is governed by an MIT-style
  5. license that can be found in the LICENSE file or at
  6. https://opensource.org/licenses/MIT.
  7. */
  8. const crypto = require('crypto');
  9. module.exports = string => {
  10. const md5 = crypto.createHash('md5');
  11. md5.update(string);
  12. return md5.digest('hex');
  13. };