get-string-hash.js 661 B

1234567891011121314151617181920
  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. var __importDefault = (this && this.__importDefault) || function (mod) {
  9. return (mod && mod.__esModule) ? mod : { "default": mod };
  10. };
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. exports.getStringHash = void 0;
  13. const crypto_1 = __importDefault(require("crypto"));
  14. function getStringHash(input) {
  15. const md5 = crypto_1.default.createHash('md5');
  16. md5.update(input);
  17. return md5.digest('hex');
  18. }
  19. exports.getStringHash = getStringHash;