@roochnetwork/rooch-sdk
Version:
38 lines (37 loc) • 1.66 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var hash_exports = {};
__export(hash_exports, {
blake2b: () => import_blake2b.blake2b,
hash160: () => hash160,
sha256: () => import_sha256.sha256,
sha256x2: () => sha256x2,
sha3_256: () => import_sha3.sha3_256,
sha512: () => import_sha512.sha512
});
module.exports = __toCommonJS(hash_exports);
var import_blake2b = require("@noble/hashes/blake2b");
var import_ripemd160 = require("@noble/hashes/ripemd160");
var import_sha3 = require("@noble/hashes/sha3");
var import_sha256 = require("@noble/hashes/sha256");
var import_sha512 = require("@noble/hashes/sha512");
var import_bytes = require("./bytes.js");
const hash160 = (msg) => (0, import_ripemd160.ripemd160)((0, import_sha256.sha256)(msg));
const sha256x2 = (...msgs) => (0, import_sha256.sha256)((0, import_sha256.sha256)((0, import_bytes.concatBytes)(...msgs)));
//# sourceMappingURL=hash.js.map