Last change
on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
553 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.default = void 0;
|
---|
| 7 |
|
---|
| 8 | var _crypto = _interopRequireDefault(require("crypto"));
|
---|
| 9 |
|
---|
| 10 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
| 11 |
|
---|
| 12 | function sha1(bytes) {
|
---|
| 13 | if (Array.isArray(bytes)) {
|
---|
| 14 | bytes = Buffer.from(bytes);
|
---|
| 15 | } else if (typeof bytes === 'string') {
|
---|
| 16 | bytes = Buffer.from(bytes, 'utf8');
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | return _crypto.default.createHash('sha1').update(bytes).digest();
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | var _default = sha1;
|
---|
| 23 | exports.default = _default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.