You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
js-md5/build/md5.min.js

10 lines
9.1 KiB
JavaScript

/**
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
2 years ago
* @version 0.8.3
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2023
* @license MIT
*/
2 years ago
!function(){"use strict";function c(t){var r=typeof t;if("string"==r)return[t,!0];if("object"==r&&null!==t){if(t.constructor===n)return[new Uint8Array(t),!1];if(p(t)||y(t))return[t,!1]}throw new Error(e)}var r,e="input is invalid type",t="object"==typeof window?window:{},i="undefined"!=typeof WorkerGlobalScope&&!!WorkerGlobalScope,h="object"==typeof process&&process.versions&&process.versions.node,i=(h?t=global:i&&(t=self),"object"==typeof module&&module.exports),s="function"==typeof define&&define.amd,n=ArrayBuffer,o="0123456789abcdef".split(""),a=[128,32768,8388608,-2147483648],f=["hex","array","digest","buffer","arrayBuffer","base64"],u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),p=Array.isArray,y=n.isView,p=p||function(t){return"[object Array]"===Object.prototype.toString.call(t)},d=(y=y||function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===n},[]);function l(t){t?(d[0]=d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0,this.blocks=d,this.buffer8=r):(t=new n(68),this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)),this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function b(r){return function(t){return new l(!0).update(t)[r]()}}g=new n(68),r=new Uint8Array(g),d=new Uint32Array(g),l.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");for(var r,e,i=c(t),h=(t=i[0],i[1]),s=0,n=t.length,o=this.blocks,a=this.buffer8;s<n;){if(this.hashed&&(this.hashed=!1,o[0]=o[16],o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),h)for(e=this.start;s<n&&e<64;++s)(r=t.charCodeAt(s))<128?a[e++]=r:(r<2048?a[e++]=192|r>>>6:(r<55296||57344<=r?a[e++]=224|r>>>12:(r=65536+((1023&r)<<10|1023&t.charCodeAt(++s)),a[e++]=240|r>>>18,a[e++]=128|r>>>12&63),a[e++]=128|r>>>6&63),a[e++]=128|63&r);else for(e=this.start;s<n&&e<64;++s)a[e++]=t[s];this.lastByteIndex=e,this.bytes+=e-this.start,64<=e?(this.start=e-64,this.hash(),this.hashed=!0):this.start=e}return 4294967295<this.bytes&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},l.prototype.finalize=function(){var t,r;this.finalized||(this.finalized=!0,(t=this.blocks)[(r=this.lastByteIndex)>>>2]|=a[3&r],56<=r&&(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())},l.prototype.hash=function(){var t,r,e,i,h,s=this.blocks,n=this.first?((n=((t=((t=s[0]-680876937)<<7|t>>>25)-271733879<<0)^(r=((r=(-271733879^(e=((e=(-1732584194^2004318071&t)+s[1]-117830708)<<12|e>>>20)+t<<0)&(-271733879^t))+s[2]-1126478375)<<17|r>>>15)+e<<0)&(e^t))+s[3]-1316259209)<<22|n>>>10)+r<<0:(t=this.h0,n=this.h1,r=this.h2,((n+=((t=((t+=((e=this.h3)^n&(r^e))+s[0]-680876936)<<7|t>>>25)+n<<0)^(r=((r+=(n^(e=((e+=(r^t&(n^r))+s[1]-389564586)<<12|e>>>20)+t<<0)&(t^n))+s[2]+606105819)<<17|r>>>15)+e<<0)&(e^t))+s[3]-1044525330)<<22|n>>>10)+r<<0),n=((n+=((t=((t+=(e^n&(r^e))+s[4]-176418897)<<7|t>>>25)+n<<0)^(r=((r+=(n^(e=((e+=(r^t&(n^r))+s[5]+1200080426)<<12|e>>>20)+t<<0)&(t^n))+s[6]-1473231341)<<17|r>>>15)+e<<0)&(e^t))+s[7]-45705983)<<22|n>>>10)+r<<0;n=((n+=((t=((t+=(e^n&(r^e))+s[8]+1770035416)<<7|t>>>25)+n<<0)^(r=((r+=(n^(e=((e+=(r^t&(n^r))+s[9]-1958414417)<<12|e>>>20)+t<<0)&(t^n))+s[10]-42063)<<17|r>>>15)+e<<0)&(e^t))+s[11]-1990404162)<<22|n>>>10)+r<<0,n=((n+=((t=((t+=(e^n&(r^e))+s[12]+1804603682)<<7|t>>>25)+n<<0)^(r=((r+=(n^(e=((e+=(r^t&(n^r))+s[13]-40341101)<<12|e>>>20)+t<<0)&(t^n))+s[14]-1502002290)<<17|r>>>15)+e<<0)&(e^t))+s[15]+1236535329)<<22|n>>>10)+r<<0,n=((n+=((e=((e+=(n^r&((t=((t+=(r^e&(n^r))+s[1]-165796510)<<5|t>>>27)+n<<0)^n))+s[6]-1069501632)<<9|e>>>23)+t<<0)^t&((r=((r+=(t^n&(e^t))+s[11]+643717713)<<14|r>>>18)+e<<0)^e))+s[0]-373897302)<<20|n>>>12)+r<<0,n=((n+=((e=((e+=(n^r&((t=((t+=(r^e&(n^r))+s[5]-701558691)<<5|t>>>27)+n<<0)^n))+s[10]+38016083)<<9|e>>>23)+t<<0)^t&((r=((r+=(t^n&(e^t))+s[15]-660478335)<<14|r>>>18)+e<<0)^e))+s[4]-40553