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-sha512/build/sha512.min.js

9 lines
11 KiB
JavaScript

/*
* [js-sha512]{@link https://github.com/emn178/js-sha512}
*
* @version 0.3.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
*/
!function(){"use strict";var e="object"==typeof window?window:{},o=!e.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;o&&(e=global);var n=!e.JS_SHA512_NO_COMMON_JS&&"object"==typeof module&&module.exports,r="function"==typeof define&&define.amd,t="0123456789abcdef".split(""),s=[-2147483648,8388608,32768,128],a=[24,16,8,0],f=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],c=[],i=function(e){return h(e,384)},u=function(e){return h(e,256)},d=function(e){return h(e,224)},h=function(e,o){var n,r,i,u,d,h,_,p,l,v,S,b,w,O,m,y,A,J,N,j,C,g,x,H,M,D,E,k,q,z,B,F,G,I,K,L,P,Q,R,T,U,V,W,X,Y=!1,Z=0,$=0,ee=0,oe=e.length;384==o?(n=3418070365,r=3238371032,i=1654270250,u=914150663,d=2438529370,h=812702999,_=355462360,p=4144912697,l=1731405415,v=4290775857,S=2394180231,b=1750603025,w=3675008525,O=1694076839,m=1203062813,y=3204075428):256==o?(n=573645204,r=4230739756,i=2673172387,u=3360449730,d=596883563,h=1867755857,_=2520282905,p=1497426621,l=2519219938,v=2827943907,S=3193839141,b=1401305490,w=721525244,O=746961066,m=246885852,y=2177182882):224==o?(n=2352822216,r=424955298,i=1944164710,u=2312950998,d=502970286,h=855612546,_=1738396948,p=1479516111,l=258812777,v=2077511080,S=2011393907,b=79989058,w=1067287976,O=1780299464,m=286451373,y=2446758561):(n=1779033703,r=4089235720,i=3144134277,u=2227873595,d=1013904242,h=4271175723,_=2773480762,p=1595750129,l=1359893119,v=2917565137,S=2600822924,b=725511199,w=528734635,O=4215389547,m=1541459225,y=327033209,o=512),A=0;do{for(c[0]=A,c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=c[16]=c[17]=c[18]=c[19]=c[20]=c[21]=c[22]=c[23]=c[24]=c[25]=c[26]=c[27]=c[28]=c[29]=c[30]=c[31]=c[32]=0,N=$;oe>Z&&128>N;++Z)J=e.charCodeAt(Z),128>J?c[N>>2]|=J<<a[3&N++]:2048>J?(c[N>>2]|=(192|J>>6)<<a[3&N++],c[N>>2]|=(128|63&J)<<a[3&N++]):55296>J||J>=57344?(c[N>>2]|=(224|J>>12)<<a[3&N++],c[N>>2]|=(128|J>>6&63)<<a[3&N++],c[N>>2]|=(128|63&J)<<a[3&N++]):(J=65536+((1023&J)<<10|1023&e.charCodeAt(++Z)),c[N>>2]|=(240|J>>18)<<a[3&N++],c[N>>2]|=(128|J>>12&63)<<a[3&N++],c[N>>2]|=(128|J>>6&63)<<a[3&N++],c[N>>2]|=(128|63&J)<<a[3&N++]);for(ee+=N-$,$=N-128,Z==oe&&(c[N>>2]|=s[3&N],++Z),A=c[32],Z>oe&&112>N&&(c[31]=ee<<3,Y=!0),j=32;160>j;j+=2)R=c[j-30],T=c[j-29],C=(R>>>1|T<<31)^(R>>>8|T<<24)^R>>>7,g=(T>>>1|R<<31)^(T>>>8|R<<24)^(T>>>7|R<<25),R=c[j-4],T=c[j-3],x=(R>>>19|T<<13)^(T>>>29|R<<3)^R>>>6,H=(T>>>19|R<<13)^(R>>>29|T<<3)^(T