爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
936 B

  1. "use strict";
  2. const utils_ossUpload_common_crypto_crypto_js = require("./crypto.js.js");
  3. (function() {
  4. var util = utils_ossUpload_common_crypto_crypto_js.Crypto.util;
  5. utils_ossUpload_common_crypto_crypto_js.Crypto.HMAC = function(hasher, message, key, options) {
  6. key = key.length > hasher._blocksize * 4 ? hasher(key, {
  7. asBytes: true
  8. }) : util.stringToBytes(key);
  9. var okey = key, ikey = key.slice(0);
  10. for (var i = 0; i < hasher._blocksize * 4; i++) {
  11. okey[i] ^= 92;
  12. ikey[i] ^= 54;
  13. }
  14. var hmacbytes = hasher(util.bytesToString(okey) + hasher(util.bytesToString(ikey) + message, {
  15. asString: true
  16. }), {
  17. asBytes: true
  18. });
  19. return options && options.asBytes ? hmacbytes : options && options.asString ? util.bytesToString(hmacbytes) : util.bytesToHex(hmacbytes);
  20. };
  21. })();
  22. //# sourceMappingURL=../../../../../.sourcemap/mp-weixin/utils/oss-upload/common/crypto/hmac.js.map