2018-06-13 22:39:39 +03:00
|
|
|
'use strict';
|
2018-06-23 03:30:50 +03:00
|
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
2018-06-13 22:39:39 +03:00
|
|
|
};
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
2018-06-23 03:30:50 +03:00
|
|
|
var hash_js_1 = __importDefault(require("hash.js"));
|
2018-06-17 23:47:28 +03:00
|
|
|
var bytes_1 = require("./bytes");
|
2018-06-13 22:39:39 +03:00
|
|
|
function sha256(data) {
|
2018-06-23 03:30:50 +03:00
|
|
|
return '0x' + (hash_js_1.default.sha256().update(bytes_1.arrayify(data)).digest('hex'));
|
2018-06-13 22:39:39 +03:00
|
|
|
}
|
|
|
|
exports.sha256 = sha256;
|
|
|
|
function sha512(data) {
|
2018-06-23 03:30:50 +03:00
|
|
|
return '0x' + (hash_js_1.default.sha512().update(bytes_1.arrayify(data)).digest('hex'));
|
2018-06-13 22:39:39 +03:00
|
|
|
}
|
|
|
|
exports.sha512 = sha512;
|