md5-3edf1152.js 10 KB

123456789
  1. import{g as commonjsGlobal}from"./index-3887ab05.js";var md5Exports={},md5$1={get exports(){return md5Exports},set exports(t){md5Exports=t}};/**
  2. * [js-md5]{@link https://github.com/emn178/js-md5}
  3. *
  4. * @namespace md5
  5. * @version 0.7.3
  6. * @author Chen, Yi-Cyuan [emn178@gmail.com]
  7. * @copyright Chen, Yi-Cyuan 2014-2017
  8. * @license MIT
  9. */(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}(root.JS_MD5_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t){return function(e){return new Md5(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Md5},t.update=function(r){return t.create().update(r)};for(var e=0;e<OUTPUT_TYPES.length;++e){var i=OUTPUT_TYPES[e];t[i]=createOutputMethod(i)}return t},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(t){if(typeof t=="string")return crypto.createHash("md5").update(t,"utf8").digest("hex");if(t==null)throw ERROR;return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash("md5").update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod};function Md5(t){if(t)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var e=new ArrayBuffer(68);this.buffer8=new Uint8Array(e),this.blocks=new Uint32Array(e)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(t){if(!this.finalized){var e,i=typeof t;if(i!=="string"){if(i==="object"){if(t===null)throw ERROR;if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw ERROR}else throw ERROR;e=!0}for(var r,f=0,s,o=t.length,h=this.blocks,a=this.buffer8;f<o;){if(this.hashed&&(this.hashed=!1,h[0]=h[16],h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),e)if(ARRAY_BUFFER)for(s=this.start;f<o&&s<64;++f)a[s++]=t[f];else for(s=this.start;f<o&&s<64;++f)h[s>>2]|=t[f]<<SHIFT[s++&3];else if(ARRAY_BUFFER)for(s=this.start;f<o&&s<64;++f)r=t.charCodeAt(f),r<128?a[s++]=r:r<2048?(a[s++]=192|r>>6,a[s++]=128|r&63):r<55296||r>=57344?(a[s++]=224|r>>12,a[s++]=128|r>>6&63,a[s++]=128|r&63):(r=65536+((r&1023)<<10|t.charCodeAt(++f)&1023),a[s++]=240|r>>18,a[s++]=128|r>>12&63,a[s++]=128|r>>6&63,a[s++]=128|r&63);else for(s=this.start;f<o&&s<64;++f)r=t.charCodeAt(f),r<128?h[s>>2]|=r<<SHIFT[s++&3]:r<2048?(h[s>>2]|=(192|r>>6)<<SHIFT[s++&3],h[s>>2]|=(128|r&63)<<SHIFT[s++&3]):r<55296||r>=57344?(h[s>>2]|=(224|r>>12)<<SHIFT[s++&3],h[s>>2]|=(128|r>>6&63)<<SHIFT[s++&3],h[s>>2]|=(128|r&63)<<SHIFT[s++&3]):(r=65536+((r&1023)<<10|t.charCodeAt(++f)&1023),h[s>>2]|=(240|r>>18)<<SHIFT[s++&3],h[s>>2]|=(128|r>>12&63)<<SHIFT[s++&3],h[s>>2]|=(128|r>>6&63)<<SHIFT[s++&3],h[s>>2]|=(128|r&63)<<SHIFT[s++&3]);this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[e>>2]|=EXTRA[e&3],e>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,t[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var t,e,i,r,f,s,o=this.blocks;this.first?(t=o[0]-680876937,t=(t<<7|t>>>25)-271733879<<0,r=(-1732584194^t&2004318071)+o[1]-117830708,r=(r<<12|r>>>20)+t<<0,i=(-271733879^r&(t^-271733879))+o[2]-1126478375,i=(i<<17|i>>>15)+r<<0,e=(t^i&(r^t))+o[3]-1316259209,e=(e<<22|e>>>10)+i<<0):(t=this.h0,e=this.h1,i=this.h2,r=this.h3,t+=(r^e&(i^r))+o[0]-680876936,t=(t<<7|t>>>25)+e<<0,r+=(i^t&(e^i))+o[1]-389564586,r=(r<<12|r>>>20)+t<<0,i+=(e^r&(t^e))+o[2]+606105819,i=(i<<17|i>>>15)+r<<0,e+=(t^i&(r^t))+o[3]-1044525330,e=(e<<22|e>>>10)+i<<0),t+=(r^e&(i^r))+o[4]-176418897,t=(t<<7|t>>>25)+e<<0,r+=(i^t&(e^i))+o[5]+1200080426,r=(r<<12|r>>>20)+t<<0,i+=(e^r&(t^e))+o[6]-1473231341,i=(i<<17|i>>>15)+r<<0,e+=(t^i&(r^t))+o[7]-45705983,e=(e<<22|e>>>10)+i<<0,t+=(r^e&(i^r))+o[8]+1770035416,t=(t<<7|t>>>25)+e<<0,r+=(i^t&(e^i))+o[9]-1958414417,r=(r<<12|r>>>20)+t<<0,i+=(e^r&(t^e))+o[10]-42063,i=(i<<17|i>>>15)+r<<0,e+=(t^i&(r^t))+o[11]-1990404162,e=(e<<22|e>>>10)+i<<0,t+=(r^e&(i^r))+o[12]+1804603682,t=(t<<7|t>>>25)+e<<0,r+=(i^t&(e^i))+o[13]-40341101,r=(r<<12|r>>>20)+t<<0,i+=(e^r&(t^e))+o[14]-1502002290,i=(i<<17|i>>>15)+r<<0,e+=(t^i&(r^t))+o[15]+1236535329,e=(e<<22|e>>>10)+i<<0,t+=(i^r&(e^i))+o[1]-165796510,t=(t<<5|t>>>27)+e<<0,r+=(e^i&(t^e))+o[6]-1069501632,r=(r<<9|r>>>23)+t<<0,i+=(t^e&(r^t))+o[11]+643717713,i=(i<<14|i>>>18)+r<<0,e+=(r^t&(i^r))+o[0]-373897302,e=(e<<20|e>>>12)+i<<0,t+=(i^r&(e^i))+o[5]-701558691,t=(t<<5|t>>>27)+e<<0,r+=(e^i&(t^e))+o[10]+38016083,r=(r<<9|r>>>23)+t<<0,i+=(t^e&(r^t))+o[15]-660478335,i=(i<<14|i>>>18)+r<<0,e+=(r^t&(i^r))+o[4]-405537848,e=(e<<20|e>>>12)+i<<0,t+=(i^r&(e^i))+o[9]+568446438,t=(t<<5|t>>>27)+e<<0,r+=(e^i&(t^e))+o[14]-1019803690,r=(r<<9|r>>>23)+t<<0,i+=(t^e&(r^t))+o[3]-187363961,i=(i<<14|i>>>18)+r<<0,e+=(r^t&(i^r))+o[8]+1163531501,e=(e<<20|e>>>12)+i<<0,t+=(i^r&(e^i))+o[13]-1444681467,t=(t<<5|t>>>27)+e<<0,r+=(e^i&(t^e))+o[2]-51403784,r=(r<<9|r>>>23)+t<<0,i+=(t^e&(r^t))+o[7]+1735328473,i=(i<<14|i>>>18)+r<<0,e+=(r^t&(i^r))+o[12]-1926607734,e=(e<<20|e>>>12)+i<<0,f=e^i,t+=(f^r)+o[5]-378558,t=(t<<4|t>>>28)+e<<0,r+=(f^t)+o[8]-2022574463,r=(r<<11|r>>>21)+t<<0,s=r^t,i+=(s^e)+o[11]+1839030562,i=(i<<16|i>>>16)+r<<0,e+=(s^i)+o[14]-35309556,e=(e<<23|e>>>9)+i<<0,f=e^i,t+=(f^r)+o[1]-1530992060,t=(t<<4|t>>>28)+e<<0,r+=(f^t)+o[4]+1272893353,r=(r<<11|r>>>21)+t<<0,s=r^t,i+=(s^e)+o[7]-155497632,i=(i<<16|i>>>16)+r<<0,e+=(s^i)+o[10]-1094730640,e=(e<<23|e>>>9)+i<<0,f=e^i,t+=(f^r)+o[13]+681279174,t=(t<<4|t>>>28)+e<<0,r+=(f^t)+o[0]-358537222,r=(r<<11|r>>>21)+t<<0,s=r^t,i+=(s^e)+o[3]-722521979,i=(i<<16|i>>>16)+r<<0,e+=(s^i)+o[6]+76029189,e=(e<<23|e>>>9)+i<<0,f=e^i,t+=(f^r)+o[9]-640364487,t=(t<<4|t>>>28)+e<<0,r+=(f^t)+o[12]-421815835,r=(r<<11|r>>>21)+t<<0,s=r^t,i+=(s^e)+o[15]+530742520,i=(i<<16|i>>>16)+r<<0,e+=(s^i)+o[2]-995338651,e=(e<<23|e>>>9)+i<<0,t+=(i^(e|~r))+o[0]-198630844,t=(t<<6|t>>>26)+e<<0,r+=(e^(t|~i))+o[7]+1126891415,r=(r<<10|r>>>22)+t<<0,i+=(t^(r|~e))+o[14]-1416354905,i=(i<<15|i>>>17)+r<<0,e+=(r^(i|~t))+o[5]-57434055,e=(e<<21|e>>>11)+i<<0,t+=(i^(e|~r))+o[12]+1700485571,t=(t<<6|t>>>26)+e<<0,r+=(e^(t|~i))+o[3]-1894986606,r=(r<<10|r>>>22)+t<<0,i+=(t^(r|~e))+o[10]-1051523,i=(i<<15|i>>>17)+r<<0,e+=(r^(i|~t))+o[1]-2054922799,e=(e<<21|e>>>11)+i<<0,t+=(i^(e|~r))+o[8]+1873313359,t=(t<<6|t>>>26)+e<<0,r+=(e^(t|~i))+o[15]-30611744,r=(r<<10|r>>>22)+t<<0,i+=(t^(r|~e))+o[6]-1560198380,i=(i<<15|i>>>17)+r<<0,e+=(r^(i|~t))+o[13]+1309151649,e=(e<<21|e>>>11)+i<<0,t+=(i^(e|~r))+o[4]-145523070,t=(t<<6|t>>>26)+e<<0,r+=(e^(t|~i))+o[11]-1120210379,r=(r<<10|r>>>22)+t<<0,i+=(t^(r|~e))+o[2]+718787259,i=(i<<15|i>>>17)+r<<0,e+=(r^(i|~t))+o[9]-343485551,e=(e<<21|e>>>11)+i<<0,this.first?(this.h0=t+1732584193<<0,this.h1=e-271733879<<0,this.h2=i-1732584194<<0,this.h3=r+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+i<<0,this.h3=this.h3+r<<0)},Md5.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,r=this.h3;return HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,r=this.h3;return[t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,i&255,i>>8&255,i>>16&255,i>>24&255,r&255,r>>8&255,r>>16&255,r>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(16),e=new Uint32Array(t);return e[0]=this.h0,e[1]=this.h1,e[2]=this.h2,e[3]=this.h3,t},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var t,e,i,r="",f=this.array(),s=0;s<15;)t=f[s++],e=f[s++],i=f[s++],r+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[(t<<4|e>>>4)&63]+BASE64_ENCODE_CHAR[(e<<2|i>>>6)&63]+BASE64_ENCODE_CHAR[i&63];return t=f[s],r+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[t<<4&63]+"==",r};var exports=createMethod();COMMON_JS?module.exports=exports:root.md5=exports})()})(md5$1);const md5=md5Exports;export{md5 as m};