|
"use strict";
|
|
const utils_ossUpload_common_crypto_crypto_js = require("./crypto.js.js");
|
|
(function() {
|
|
var util = utils_ossUpload_common_crypto_crypto_js.Crypto.util;
|
|
utils_ossUpload_common_crypto_crypto_js.Crypto.HMAC = function(hasher, message, key, options) {
|
|
key = key.length > hasher._blocksize * 4 ? hasher(key, {
|
|
asBytes: true
|
|
}) : util.stringToBytes(key);
|
|
var okey = key, ikey = key.slice(0);
|
|
for (var i = 0; i < hasher._blocksize * 4; i++) {
|
|
okey[i] ^= 92;
|
|
ikey[i] ^= 54;
|
|
}
|
|
var hmacbytes = hasher(util.bytesToString(okey) + hasher(util.bytesToString(ikey) + message, {
|
|
asString: true
|
|
}), {
|
|
asBytes: true
|
|
});
|
|
return options && options.asBytes ? hmacbytes : options && options.asString ? util.bytesToString(hmacbytes) : util.bytesToHex(hmacbytes);
|
|
};
|
|
})();
|
|
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/utils/oss-upload/common/crypto/hmac.js.map
|