blake2b.js 477 B

12345678910111213
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.blake2b = void 0;
  4. const blake2b_1 = require("@noble/hashes/blake2b");
  5. const utils_js_1 = require("./utils.js");
  6. const blake2b = (msg, outputLength = 64) => {
  7. (0, utils_js_1.assertBytes)(msg);
  8. if (outputLength <= 0 || outputLength > 64) {
  9. throw Error("Invalid outputLength");
  10. }
  11. return (0, blake2b_1.blake2b)(msg, { dkLen: outputLength });
  12. };
  13. exports.blake2b = blake2b;