@cryptography/sha512
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -1,1 +0,1 @@ | ||
module.exports=function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=0)}([function(t,r,e){"use strict";function n(t,r){return t.charCodeAt(r)<<24^t.charCodeAt(r+1)<<16^t.charCodeAt(r+2)<<8^t.charCodeAt(r+3)}function o(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}Object.defineProperty(r,"__esModule",{value:!0});for(var i=new Uint32Array([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]),u=String.fromCharCode(128),a=0;a<128;a+=1)u+=String.fromCharCode(0);var f=new Uint32Array(160);function s(){var t=new Uint32Array(16);return t[0]=1779033703,t[1]=4089235720,t[2]=3144134277,t[3]=2227873595,t[4]=1013904242,t[5]=4271175723,t[6]=2773480762,t[7]=1595750129,t[8]=1359893119,t[9]=2917565137,t[10]=2600822924,t[11]=725511199,t[12]=528734635,t[13]=4215389547,t[14]=1541459225,t[15]=327033209,t}function c(t,r){var e,o,u,a,s,c,d,l,h,g,p,y,b,v,C,m,S,j,O,_,A,x,P,w,M,U,T,k,L,q=0;r.substr(0,1);for(var z=r.length;z>=128;){for(d=t[0],l=t[1],h=t[2],g=t[3],p=t[4],y=t[5],b=t[6],v=t[7],C=t[8],m=t[9],S=t[10],j=t[11],O=t[12],_=t[13],A=t[14],x=t[15],q=0,L=0;L<32;L+=2)f[L]=n(r,q),f[L+1]=n(r,q+4),q+=8;for(;L<160;L+=2)u=(((e=f[L-4])>>>19|(o=f[L-3])<<13)^(o>>>29|e<<3)^e>>>6)>>>0,a=((e<<13|o>>>19)^(o<<3|e>>>29)^(e<<26|o>>>6))>>>0,s=(((e=f[L-30])>>>1|(o=f[L-29])<<31)^(e>>>8|o<<24)^e>>>7)>>>0,c=((e<<31|o>>>1)^(e<<24|o>>>8)^(e<<25|o>>>7))>>>0,o=a+f[L-13]+c+f[L-31],f[L]=u+f[L-14]+s+f[L-32]+(o/4294967296>>>0),f[L+1]=o;for(L=0;L<160;L+=2)P=((C>>>14|m<<18)^(C>>>18|m<<14)^(m>>>9|C<<23))>>>0,w=(O^C&(S^O))>>>0,M=((d>>>28|l<<4)^(l>>>2|d<<30)^(l>>>7|d<<25))>>>0,U=((d<<4|l>>>28)^(l<<30|d>>>2)^(l<<25|d>>>7))>>>0,T=(d&h|p&(d^h))>>>0,k=(l&g|y&(l^g))>>>0,a=x+(((C<<18|m>>>14)^(C<<14|m>>>18)^(m<<23|C>>>9))>>>0)+((_^m&(j^_))>>>0)+i[L+1]+f[L+1],u=A+P+w+i[L]+f[L]+(a/4294967296>>>0)>>>0,A=O,x=_,O=S,_=j,S=C,j=m,C=b+u+((m=v+(a>>>=0))/4294967296>>>0)>>>0,m>>>=0,b=p,v=y,p=h,y=g,h=d,g=l,d=u+(s=M+T+((c=U+k)/4294967296>>>0)>>>0)+((l=a+(c>>>=0))/4294967296>>>0)>>>0,l>>>=0;o=t[1]+l,t[0]=t[0]+d+(o/4294967296>>>0),t[1]=o,o=t[3]+g,t[2]=t[2]+h+(o/4294967296>>>0),t[3]=o,o=t[5]+y,t[4]=t[4]+p+(o/4294967296>>>0),t[5]=o,o=t[7]+v,t[6]=t[6]+b+(o/4294967296>>>0),t[7]=o,o=t[9]+m,t[8]=t[8]+C+(o/4294967296>>>0),t[9]=o,o=t[11]+j,t[10]=t[10]+S+(o/4294967296>>>0),t[11]=o,o=t[13]+_,t[12]=t[12]+O+(o/4294967296>>>0),t[13]=o,o=t[15]+x,t[14]=t[14]+A+(o/4294967296>>>0),t[15]=o,r=r.slice(128),z-=128}return r}function d(t,r,e){void 0===e&&(e=r.length),c(t,r+u.substr(0,128-(16+(e>>>0))&127)+o(0)+o(0)+o(8*e/4294967296>>>0)+o(8*e|0))}function l(t){return o(t[0])+o(t[1])+o(t[2])+o(t[3])+o(t[4])+o(t[5])+o(t[6])+o(t[7])+o(t[8])+o(t[9])+o(t[10])+o(t[11])+o(t[12])+o(t[13])+o(t[14])+o(t[15])}function h(t,r){var e=s();return d(e,t),"array"===r?e:l(e)}var g=function(){return this.data="",this.length=0,this.state=s(),this.update=function(t){return this.length+=t.length,this.data=c(this.state,this.data+t),this},this.digest=function(t){return d(this.state,this.data,this.length),"array"===t?this.state:l(this.state)},this};h.stream=function(){return new g},h.blockLength=128,r.default=h}]); | ||
module.exports=(()=>{"use strict";var t={607:(t,r)=>{function e(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}Object.defineProperty(r,"__esModule",{value:!0});for(var n=new Uint32Array([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]),i=String.fromCharCode(128),o=0;o<128;o+=1)i+=String.fromCharCode(0);var s=new Uint32Array(160);function a(){var t=new Uint32Array(16);return t[0]=1779033703,t[1]=4089235720,t[2]=3144134277,t[3]=2227873595,t[4]=1013904242,t[5]=4271175723,t[6]=2773480762,t[7]=1595750129,t[8]=1359893119,t[9]=2917565137,t[10]=2600822924,t[11]=725511199,t[12]=528734635,t[13]=4215389547,t[14]=1541459225,t[15]=327033209,t}function h(t,r){var e,i,o,a,h,u,f,d,g,c,l,C,v,y,p,m,A,b,w,S,x,U,L,_,j,k,E,M,O,P=0,q=0;if("string"==typeof r)q=r.length,O=function(t,r){return n=4*r,(e=t).charCodeAt(n)<<24^e.charCodeAt(n+1)<<16^e.charCodeAt(n+2)<<8^e.charCodeAt(n+3);var e,n},r.substr(0,1);else{if(r.length%32!=0)throw new Error("sha512: Uint32Array length should be divisible by 32");q=4*r.length,O=function(t,r){return t[r]}}for(;q>=128;){for(f=t[0],d=t[1],g=t[2],c=t[3],l=t[4],C=t[5],v=t[6],y=t[7],p=t[8],m=t[9],A=t[10],b=t[11],w=t[12],S=t[13],x=t[14],U=t[15],P=0;P<32;P+=2)s[P]=O(r,P),s[P+1]=O(r,P+1);for(;P<160;P+=2)o=(((e=s[P-4])>>>19|(i=s[P-3])<<13)^(i>>>29|e<<3)^e>>>6)>>>0,a=((e<<13|i>>>19)^(i<<3|e>>>29)^(e<<26|i>>>6))>>>0,h=(((e=s[P-30])>>>1|(i=s[P-29])<<31)^(e>>>8|i<<24)^e>>>7)>>>0,u=((e<<31|i>>>1)^(e<<24|i>>>8)^(e<<25|i>>>7))>>>0,i=a+s[P-13]+u+s[P-31],s[P]=o+s[P-14]+h+s[P-32]+(i/4294967296>>>0),s[P+1]=i;for(P=0;P<160;P+=2)L=((p>>>14|m<<18)^(p>>>18|m<<14)^(m>>>9|p<<23))>>>0,_=(w^p&(A^w))>>>0,j=((f>>>28|d<<4)^(d>>>2|f<<30)^(d>>>7|f<<25))>>>0,k=((f<<4|d>>>28)^(d<<30|f>>>2)^(d<<25|f>>>7))>>>0,E=(f&g|l&(f^g))>>>0,M=(d&c|C&(d^c))>>>0,a=U+(((p<<18|m>>>14)^(p<<14|m>>>18)^(m<<23|p>>>9))>>>0)+((S^m&(b^S))>>>0)+n[P+1]+s[P+1],o=x+L+_+n[P]+s[P]+(a/4294967296>>>0)>>>0,x=w,U=S,w=A,S=b,A=p,b=m,p=v+o+((m=y+(a>>>=0))/4294967296>>>0)>>>0,m>>>=0,v=l,y=C,l=g,C=c,g=f,c=d,f=o+(h=j+E+((u=k+M)/4294967296>>>0)>>>0)+((d=a+(u>>>=0))/4294967296>>>0)>>>0,d>>>=0;i=t[1]+d,t[0]=t[0]+f+(i/4294967296>>>0),t[1]=i,i=t[3]+c,t[2]=t[2]+g+(i/4294967296>>>0),t[3]=i,i=t[5]+C,t[4]=t[4]+l+(i/4294967296>>>0),t[5]=i,i=t[7]+y,t[6]=t[6]+v+(i/4294967296>>>0),t[7]=i,i=t[9]+m,t[8]=t[8]+p+(i/4294967296>>>0),t[9]=i,i=t[11]+b,t[10]=t[10]+A+(i/4294967296>>>0),t[11]=i,i=t[13]+S,t[12]=t[12]+w+(i/4294967296>>>0),t[13]=i,i=t[15]+U,t[14]=t[14]+x+(i/4294967296>>>0),t[15]=i,q-=128,"string"==typeof r&&(r=r.slice(128))}return r}function u(t,r,n){void 0===n&&(n=r.length),h(t,r+i.substr(0,128-(16+(n>>>0))&127)+e(0)+e(0)+e(8*n/4294967296>>>0)+e(8*n|0))}function f(t){return e(t[0])+e(t[1])+e(t[2])+e(t[3])+e(t[4])+e(t[5])+e(t[6])+e(t[7])+e(t[8])+e(t[9])+e(t[10])+e(t[11])+e(t[12])+e(t[13])+e(t[14])+e(t[15])}function d(t,r){var e=a();return u(e,t),"array"===r?e:f(e)}var g=function(){return this.data="",this.length=0,this.state=a(),this.update=function(t){return"string"==typeof t?(this.length+=t.length,this.data=h(this.state,this.data+t)):(this.length+=4*t.length,h(this.state,t)),this},this.digest=function(t){return u(this.state,this.data,this.length),"array"===t?this.state:f(this.state)},this};d.stream=function(){return new g},d.blockLength=128,d.digestLength=64,r.default=d}},r={};return function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{}};return t[n](i,i.exports,e),i.exports}(607)})(); |
@@ -15,2 +15,3 @@ /** | ||
var blockLength: number; | ||
var digestLength: number; | ||
} | ||
@@ -21,2 +22,3 @@ declare function sha512(message: string, out: 'array'): Uint32Array; | ||
var blockLength: number; | ||
var digestLength: number; | ||
} | ||
@@ -27,3 +29,3 @@ interface StreamInterface { | ||
state: Uint32Array; | ||
update(data: string): StreamInterface; | ||
update(data: string | Uint32Array): StreamInterface; | ||
digest(): string; | ||
@@ -30,0 +32,0 @@ digest(format: 'array'): Uint32Array; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.sha512=e():t.sha512=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";function n(t,e){return t.charCodeAt(e)<<24^t.charCodeAt(e+1)<<16^t.charCodeAt(e+2)<<8^t.charCodeAt(e+3)}function o(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}Object.defineProperty(e,"__esModule",{value:!0});for(var i=new Uint32Array([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]),u=String.fromCharCode(128),a=0;a<128;a+=1)u+=String.fromCharCode(0);var f=new Uint32Array(160);function s(){var t=new Uint32Array(16);return t[0]=1779033703,t[1]=4089235720,t[2]=3144134277,t[3]=2227873595,t[4]=1013904242,t[5]=4271175723,t[6]=2773480762,t[7]=1595750129,t[8]=1359893119,t[9]=2917565137,t[10]=2600822924,t[11]=725511199,t[12]=528734635,t[13]=4215389547,t[14]=1541459225,t[15]=327033209,t}function c(t,e){var r,o,u,a,s,c,d,l,h,p,y,b,g,v,m,C,j,S,x,O,_,w,A,P,M,U,T,k,L,q=0;e.substr(0,1);for(var z=e.length;z>=128;){for(d=t[0],l=t[1],h=t[2],p=t[3],y=t[4],b=t[5],g=t[6],v=t[7],m=t[8],C=t[9],j=t[10],S=t[11],x=t[12],O=t[13],_=t[14],w=t[15],q=0,L=0;L<32;L+=2)f[L]=n(e,q),f[L+1]=n(e,q+4),q+=8;for(;L<160;L+=2)u=(((r=f[L-4])>>>19|(o=f[L-3])<<13)^(o>>>29|r<<3)^r>>>6)>>>0,a=((r<<13|o>>>19)^(o<<3|r>>>29)^(r<<26|o>>>6))>>>0,s=(((r=f[L-30])>>>1|(o=f[L-29])<<31)^(r>>>8|o<<24)^r>>>7)>>>0,c=((r<<31|o>>>1)^(r<<24|o>>>8)^(r<<25|o>>>7))>>>0,o=a+f[L-13]+c+f[L-31],f[L]=u+f[L-14]+s+f[L-32]+(o/4294967296>>>0),f[L+1]=o;for(L=0;L<160;L+=2)A=((m>>>14|C<<18)^(m>>>18|C<<14)^(C>>>9|m<<23))>>>0,P=(x^m&(j^x))>>>0,M=((d>>>28|l<<4)^(l>>>2|d<<30)^(l>>>7|d<<25))>>>0,U=((d<<4|l>>>28)^(l<<30|d>>>2)^(l<<25|d>>>7))>>>0,T=(d&h|y&(d^h))>>>0,k=(l&p|b&(l^p))>>>0,a=w+(((m<<18|C>>>14)^(m<<14|C>>>18)^(C<<23|m>>>9))>>>0)+((O^C&(S^O))>>>0)+i[L+1]+f[L+1],u=_+A+P+i[L]+f[L]+(a/4294967296>>>0)>>>0,_=x,w=O,x=j,O=S,j=m,S=C,m=g+u+((C=v+(a>>>=0))/4294967296>>>0)>>>0,C>>>=0,g=y,v=b,y=h,b=p,h=d,p=l,d=u+(s=M+T+((c=U+k)/4294967296>>>0)>>>0)+((l=a+(c>>>=0))/4294967296>>>0)>>>0,l>>>=0;o=t[1]+l,t[0]=t[0]+d+(o/4294967296>>>0),t[1]=o,o=t[3]+p,t[2]=t[2]+h+(o/4294967296>>>0),t[3]=o,o=t[5]+b,t[4]=t[4]+y+(o/4294967296>>>0),t[5]=o,o=t[7]+v,t[6]=t[6]+g+(o/4294967296>>>0),t[7]=o,o=t[9]+C,t[8]=t[8]+m+(o/4294967296>>>0),t[9]=o,o=t[11]+S,t[10]=t[10]+j+(o/4294967296>>>0),t[11]=o,o=t[13]+O,t[12]=t[12]+x+(o/4294967296>>>0),t[13]=o,o=t[15]+w,t[14]=t[14]+_+(o/4294967296>>>0),t[15]=o,e=e.slice(128),z-=128}return e}function d(t,e,r){void 0===r&&(r=e.length),c(t,e+u.substr(0,128-(16+(r>>>0))&127)+o(0)+o(0)+o(8*r/4294967296>>>0)+o(8*r|0))}function l(t){return o(t[0])+o(t[1])+o(t[2])+o(t[3])+o(t[4])+o(t[5])+o(t[6])+o(t[7])+o(t[8])+o(t[9])+o(t[10])+o(t[11])+o(t[12])+o(t[13])+o(t[14])+o(t[15])}function h(t,e){var r=s();return d(r,t),"array"===e?r:l(r)}var p=function(){return this.data="",this.length=0,this.state=s(),this.update=function(t){return this.length+=t.length,this.data=c(this.state,this.data+t),this},this.digest=function(t){return d(this.state,this.data,this.length),"array"===t?this.state:l(this.state)},this};h.stream=function(){return new p},h.blockLength=128,e.default=h}])})); | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.sha512=r():t.sha512=r()}(window,(function(){return(()=>{"use strict";var t={607:(t,r)=>{function e(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}Object.defineProperty(r,"__esModule",{value:!0});for(var n=new Uint32Array([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]),o=String.fromCharCode(128),i=0;i<128;i+=1)o+=String.fromCharCode(0);var s=new Uint32Array(160);function a(){var t=new Uint32Array(16);return t[0]=1779033703,t[1]=4089235720,t[2]=3144134277,t[3]=2227873595,t[4]=1013904242,t[5]=4271175723,t[6]=2773480762,t[7]=1595750129,t[8]=1359893119,t[9]=2917565137,t[10]=2600822924,t[11]=725511199,t[12]=528734635,t[13]=4215389547,t[14]=1541459225,t[15]=327033209,t}function h(t,r){var e,o,i,a,h,f,u,d,c,g,l,p,C,y,v,b,m,w,x,A,S,j,U,L,_,k,E,M,O,P=0,q=0;if("string"==typeof r)q=r.length,O=function(t,r){return n=4*r,(e=t).charCodeAt(n)<<24^e.charCodeAt(n+1)<<16^e.charCodeAt(n+2)<<8^e.charCodeAt(n+3);var e,n},r.substr(0,1);else{if(r.length%32!=0)throw new Error("sha512: Uint32Array length should be divisible by 32");q=4*r.length,O=function(t,r){return t[r]}}for(;q>=128;){for(u=t[0],d=t[1],c=t[2],g=t[3],l=t[4],p=t[5],C=t[6],y=t[7],v=t[8],b=t[9],m=t[10],w=t[11],x=t[12],A=t[13],S=t[14],j=t[15],P=0;P<32;P+=2)s[P]=O(r,P),s[P+1]=O(r,P+1);for(;P<160;P+=2)i=(((e=s[P-4])>>>19|(o=s[P-3])<<13)^(o>>>29|e<<3)^e>>>6)>>>0,a=((e<<13|o>>>19)^(o<<3|e>>>29)^(e<<26|o>>>6))>>>0,h=(((e=s[P-30])>>>1|(o=s[P-29])<<31)^(e>>>8|o<<24)^e>>>7)>>>0,f=((e<<31|o>>>1)^(e<<24|o>>>8)^(e<<25|o>>>7))>>>0,o=a+s[P-13]+f+s[P-31],s[P]=i+s[P-14]+h+s[P-32]+(o/4294967296>>>0),s[P+1]=o;for(P=0;P<160;P+=2)U=((v>>>14|b<<18)^(v>>>18|b<<14)^(b>>>9|v<<23))>>>0,L=(x^v&(m^x))>>>0,_=((u>>>28|d<<4)^(d>>>2|u<<30)^(d>>>7|u<<25))>>>0,k=((u<<4|d>>>28)^(d<<30|u>>>2)^(d<<25|u>>>7))>>>0,E=(u&c|l&(u^c))>>>0,M=(d&g|p&(d^g))>>>0,a=j+(((v<<18|b>>>14)^(v<<14|b>>>18)^(b<<23|v>>>9))>>>0)+((A^b&(w^A))>>>0)+n[P+1]+s[P+1],i=S+U+L+n[P]+s[P]+(a/4294967296>>>0)>>>0,S=x,j=A,x=m,A=w,m=v,w=b,v=C+i+((b=y+(a>>>=0))/4294967296>>>0)>>>0,b>>>=0,C=l,y=p,l=c,p=g,c=u,g=d,u=i+(h=_+E+((f=k+M)/4294967296>>>0)>>>0)+((d=a+(f>>>=0))/4294967296>>>0)>>>0,d>>>=0;o=t[1]+d,t[0]=t[0]+u+(o/4294967296>>>0),t[1]=o,o=t[3]+g,t[2]=t[2]+c+(o/4294967296>>>0),t[3]=o,o=t[5]+p,t[4]=t[4]+l+(o/4294967296>>>0),t[5]=o,o=t[7]+y,t[6]=t[6]+C+(o/4294967296>>>0),t[7]=o,o=t[9]+b,t[8]=t[8]+v+(o/4294967296>>>0),t[9]=o,o=t[11]+w,t[10]=t[10]+m+(o/4294967296>>>0),t[11]=o,o=t[13]+A,t[12]=t[12]+x+(o/4294967296>>>0),t[13]=o,o=t[15]+j,t[14]=t[14]+S+(o/4294967296>>>0),t[15]=o,q-=128,"string"==typeof r&&(r=r.slice(128))}return r}function f(t,r,n){void 0===n&&(n=r.length),h(t,r+o.substr(0,128-(16+(n>>>0))&127)+e(0)+e(0)+e(8*n/4294967296>>>0)+e(8*n|0))}function u(t){return e(t[0])+e(t[1])+e(t[2])+e(t[3])+e(t[4])+e(t[5])+e(t[6])+e(t[7])+e(t[8])+e(t[9])+e(t[10])+e(t[11])+e(t[12])+e(t[13])+e(t[14])+e(t[15])}function d(t,r){var e=a();return f(e,t),"array"===r?e:u(e)}var c=function(){return this.data="",this.length=0,this.state=a(),this.update=function(t){return"string"==typeof t?(this.length+=t.length,this.data=h(this.state,this.data+t)):(this.length+=4*t.length,h(this.state,t)),this},this.digest=function(t){return f(this.state,this.data,this.length),"array"===t?this.state:u(this.state)},this};d.stream=function(){return new c},d.blockLength=128,d.digestLength=64,r.default=d}},r={};return function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{}};return t[n](o,o.exports,e),o.exports}(607)})()})); |
{ | ||
"name": "@cryptography/sha512", | ||
"description": "https://github.com/js-cryptography/sha512", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author": "Konstantin Darutkin", | ||
@@ -37,3 +37,3 @@ "scripts": { | ||
"uglify-js": "^3.7.1", | ||
"webpack": "^4.40.2", | ||
"webpack": "5.0.0-beta.9", | ||
"webpack-bundle-analyzer": "^3.6.0", | ||
@@ -40,0 +40,0 @@ "webpack-cli": "^3.3.9" |
@@ -39,3 +39,7 @@ # @cryptography/sha512 | ||
## Performance | ||
Benchmarks: | ||
* https://jsbench.me/gak3pyle85/3 | ||
## Contributing | ||
Contributions are welcome! Contribution guidelines will be published later. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
31
44
1
32178