sha1.js 396 B

12345678910111213
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const crypto_1 = require("crypto");
  4. function sha1(bytes) {
  5. if (Array.isArray(bytes)) {
  6. bytes = Buffer.from(bytes);
  7. }
  8. else if (typeof bytes === 'string') {
  9. bytes = Buffer.from(bytes, 'utf8');
  10. }
  11. return (0, crypto_1.createHash)('sha1').update(bytes).digest();
  12. }
  13. exports.default = sha1;