Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cryptography/sha512

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cryptography/sha512 - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

dist/cjs/sha512.js

2

dist/cjs/sha512.min.js

@@ -1,1 +0,1 @@

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)})();
"use strict";function t(t,r){return t.charCodeAt(r)<<24^t.charCodeAt(r+1)<<16^t.charCodeAt(r+2)<<8^t.charCodeAt(r+3)}function r(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}function e(t){return("00000000"+t.toString(16)).slice(-8)}function n(t){return t||(t=new Uint32Array(16)),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}var i=new Uint32Array(160),h=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]);function s(t,r){var e=t[0],n=t[1],s=t[2],o=t[3],f=t[4],a=t[5],u=t[6],l=t[7],g=t[8],c=t[9],d=t[10],v=t[11],y=t[12],C=t[13],p=t[14],b=t[15];i.set(r);for(var w=32;w<160;w+=2){var A=i[w-4],m=i[w-3],U=((A>>>19|m<<13)^(m>>>29|A<<3)^A>>>6)>>>0,S=((A<<13|m>>>19)^(m<<3|A>>>29)^(A<<26|m>>>6))>>>0,x=(((A=i[w-30])>>>1|(m=i[w-29])<<31)^(A>>>8|m<<24)^A>>>7)>>>0,L=((A<<31|m>>>1)^(A<<24|m>>>8)^(A<<25|m>>>7))>>>0;m=S+i[w-13]+L+i[w-31],i[w]=U+i[w-14]+x+i[w-32]+(m/4294967296>>>0),i[w+1]=m}for(w=0;w<160;w+=2){var k=((g>>>14|c<<18)^(g>>>18|c<<14)^(c>>>9|g<<23))>>>0,E=(y^g&(d^y))>>>0,j=((e>>>28|n<<4)^(n>>>2|e<<30)^(n>>>7|e<<25))>>>0,q=((e<<4|n>>>28)^(n<<30|e>>>2)^(n<<25|e>>>7))>>>0,z=(e&s|f&(e^s))>>>0,B=(n&o|a&(n^o))>>>0;S=b+(((g<<18|c>>>14)^(g<<14|c>>>18)^(c<<23|g>>>9))>>>0)+((C^c&(v^C))>>>0)+h[w+1]+i[w+1],U=p+k+E+h[w]+i[w]+(S/4294967296>>>0)>>>0;p=y,b=C,y=d,C=v,d=g,v=c,g=u+U+((c=l+(S>>>=0))/4294967296>>>0)>>>0,c>>>=0,u=f,l=a,f=s,a=o,s=e,o=n,e=U+(x=j+z+((L=q+B)/4294967296>>>0)>>>0)+((n=S+(L>>>=0))/4294967296>>>0)>>>0,n>>>=0}var D=t[1]+n;t[0]=t[0]+e+(D/4294967296>>>0),t[1]=D,D=t[3]+o,t[2]=t[2]+s+(D/4294967296>>>0),t[3]=D,D=t[5]+a,t[4]=t[4]+f+(D/4294967296>>>0),t[5]=D,D=t[7]+l,t[6]=t[6]+u+(D/4294967296>>>0),t[7]=D,D=t[9]+c,t[8]=t[8]+g+(D/4294967296>>>0),t[9]=D,D=t[11]+v,t[10]=t[10]+d+(D/4294967296>>>0),t[11]=D,D=t[13]+C,t[12]=t[12]+y+(D/4294967296>>>0),t[13]=D,D=t[15]+b,t[14]=t[14]+p+(D/4294967296>>>0),t[15]=D}function o(r,e,n,i){for(void 0===i&&(i=0);r.length>=128;){for(var h=i;h<32;h++)e[h]=t(r,4*h);r=r.slice(128-4*i),i=0,s(n,e)}return r}function f(t,r,e,n){for(void 0===n&&(n=0);t.length>=r.length-n;)r.set(t.subarray(0,r.length-n),n),t=t.subarray(r.length-n),n=0,s(e,r);return t.length>0&&(r.set(t,n),n+=t.length),n}function a(t,r,e,n){void 0===n&&(n=0);for(var i=n+1;i<r.length;i++)r[i]=0;if(n>=28){s(e,r);for(i=0;i<r.length;i++)r[i]=0}r[30]=8*t/4294967296>>>0,r[31]=8*t|0,s(e,r)}function u(r,e,n,i,h){for(void 0===h&&(h=0);r.length>=4;h++)n[h]=t(r,0),r=r.slice(4);h>=32&&(s(i,n),h=0),n[h]=t(r+"€\0\0\0",0),a(e,n,i,h)}function l(t,r,e,n){void 0===n&&(n=0),r[n]=2147483648,a(t,r,e,n)}function g(t,n){switch(void 0===n&&(n="array"),n){case"hex":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]);case"binary":return r(t[0])+r(t[1])+r(t[2])+r(t[3])+r(t[4])+r(t[5])+r(t[6])+r(t[7])+r(t[8])+r(t[9])+r(t[10])+r(t[11])+r(t[12])+r(t[13])+r(t[14])+r(t[15]);default:return t}}var c=function(){function t(t){this.buffer=new Uint32Array(32),this.state=n(t),this.length=0,this.offset=0,this.tail=""}return t.prototype.update=function(t){if("string"==typeof t)this.length+=t.length,this.tail=o(this.tail+t,this.buffer,this.state,this.offset),this.offset=0;else{if(this.tail.length>0)throw new Error("Unable to update hash-stream with array");this.length+=4*t.length,this.offset=f(t,this.buffer,this.state,this.offset)}return this},t.prototype.digest=function(t){return void 0===t&&(t="array"),this.tail.length>0?u(this.tail,this.length,this.buffer,this.state,this.offset):l(this.length,this.buffer,this.state,this.offset),g(this.state,t)},t.prototype.clear=function(){this.state=n(),this.length=0,this.offset=0,this.tail=""},t}();function d(t,r){void 0===r&&(r="array");var e=new Uint32Array(32),i=n();return"string"==typeof t?u(o(t,e,i),t.length,e,i):l(4*t.length,e,i,f(t,e,i)),g(i,r)}d.stream=function(t){return new c(t)},d.blockLength=128,d.digestLength=64,module.exports=d;

@@ -1,1 +0,1 @@

!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)})()}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).sha512=e()}(this,(function(){"use strict";function t(t,e){return t.charCodeAt(e)<<24^t.charCodeAt(e+1)<<16^t.charCodeAt(e+2)<<8^t.charCodeAt(e+3)}function e(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}function r(t){return("00000000"+t.toString(16)).slice(-8)}function n(t){return t||(t=new Uint32Array(16)),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}var i=new Uint32Array(160),o=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]);function s(t,e){var r=t[0],n=t[1],s=t[2],h=t[3],f=t[4],a=t[5],u=t[6],l=t[7],c=t[8],g=t[9],d=t[10],y=t[11],v=t[12],p=t[13],C=t[14],b=t[15];i.set(e);for(var w=32;w<160;w+=2){var m=i[w-4],A=i[w-3],U=((m>>>19|A<<13)^(A>>>29|m<<3)^m>>>6)>>>0,S=((m<<13|A>>>19)^(A<<3|m>>>29)^(m<<26|A>>>6))>>>0,x=(((m=i[w-30])>>>1|(A=i[w-29])<<31)^(m>>>8|A<<24)^m>>>7)>>>0,L=((m<<31|A>>>1)^(m<<24|A>>>8)^(m<<25|A>>>7))>>>0;A=S+i[w-13]+L+i[w-31],i[w]=U+i[w-14]+x+i[w-32]+(A/4294967296>>>0),i[w+1]=A}for(w=0;w<160;w+=2){var j=((c>>>14|g<<18)^(c>>>18|g<<14)^(g>>>9|c<<23))>>>0,k=(v^c&(d^v))>>>0,E=((r>>>28|n<<4)^(n>>>2|r<<30)^(n>>>7|r<<25))>>>0,q=((r<<4|n>>>28)^(n<<30|r>>>2)^(n<<25|r>>>7))>>>0,z=(r&s|f&(r^s))>>>0,B=(n&h|a&(n^h))>>>0;S=b+(((c<<18|g>>>14)^(c<<14|g>>>18)^(g<<23|c>>>9))>>>0)+((p^g&(y^p))>>>0)+o[w+1]+i[w+1],U=C+j+k+o[w]+i[w]+(S/4294967296>>>0)>>>0;C=v,b=p,v=d,p=y,d=c,y=g,c=u+U+((g=l+(S>>>=0))/4294967296>>>0)>>>0,g>>>=0,u=f,l=a,f=s,a=h,s=r,h=n,r=U+(x=E+z+((L=q+B)/4294967296>>>0)>>>0)+((n=S+(L>>>=0))/4294967296>>>0)>>>0,n>>>=0}var D=t[1]+n;t[0]=t[0]+r+(D/4294967296>>>0),t[1]=D,D=t[3]+h,t[2]=t[2]+s+(D/4294967296>>>0),t[3]=D,D=t[5]+a,t[4]=t[4]+f+(D/4294967296>>>0),t[5]=D,D=t[7]+l,t[6]=t[6]+u+(D/4294967296>>>0),t[7]=D,D=t[9]+g,t[8]=t[8]+c+(D/4294967296>>>0),t[9]=D,D=t[11]+y,t[10]=t[10]+d+(D/4294967296>>>0),t[11]=D,D=t[13]+p,t[12]=t[12]+v+(D/4294967296>>>0),t[13]=D,D=t[15]+b,t[14]=t[14]+C+(D/4294967296>>>0),t[15]=D}function h(e,r,n,i){for(void 0===i&&(i=0);e.length>=128;){for(var o=i;o<32;o++)r[o]=t(e,4*o);e=e.slice(128-4*i),i=0,s(n,r)}return e}function f(t,e,r,n){for(void 0===n&&(n=0);t.length>=e.length-n;)e.set(t.subarray(0,e.length-n),n),t=t.subarray(e.length-n),n=0,s(r,e);return t.length>0&&(e.set(t,n),n+=t.length),n}function a(t,e,r,n){void 0===n&&(n=0);for(var i=n+1;i<e.length;i++)e[i]=0;if(n>=28){s(r,e);for(i=0;i<e.length;i++)e[i]=0}e[30]=8*t/4294967296>>>0,e[31]=8*t|0,s(r,e)}function u(e,r,n,i,o){for(void 0===o&&(o=0);e.length>=4;o++)n[o]=t(e,0),e=e.slice(4);o>=32&&(s(i,n),o=0),n[o]=t(e+"€\0\0\0",0),a(r,n,i,o)}function l(t,e,r,n){void 0===n&&(n=0),e[n]=2147483648,a(t,e,r,n)}function c(t,n){switch(void 0===n&&(n="array"),n){case"hex":return r(t[0])+r(t[1])+r(t[2])+r(t[3])+r(t[4])+r(t[5])+r(t[6])+r(t[7])+r(t[8])+r(t[9])+r(t[10])+r(t[11])+r(t[12])+r(t[13])+r(t[14])+r(t[15]);case"binary":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]);default:return t}}var g=function(){function t(t){this.buffer=new Uint32Array(32),this.state=n(t),this.length=0,this.offset=0,this.tail=""}return t.prototype.update=function(t){if("string"==typeof t)this.length+=t.length,this.tail=h(this.tail+t,this.buffer,this.state,this.offset),this.offset=0;else{if(this.tail.length>0)throw new Error("Unable to update hash-stream with array");this.length+=4*t.length,this.offset=f(t,this.buffer,this.state,this.offset)}return this},t.prototype.digest=function(t){return void 0===t&&(t="array"),this.tail.length>0?u(this.tail,this.length,this.buffer,this.state,this.offset):l(this.length,this.buffer,this.state,this.offset),c(this.state,t)},t.prototype.clear=function(){this.state=n(),this.length=0,this.offset=0,this.tail=""},t}();function d(t,e){void 0===e&&(e="array");var r=new Uint32Array(32),i=n();return"string"==typeof t?u(h(t,r,i),t.length,r,i):l(4*t.length,r,i,f(t,r,i)),c(i,e)}return d.stream=function(t){return new g(t)},d.blockLength=128,d.digestLength=64,d}));
{
"name": "@cryptography/sha512",
"description": "https://github.com/js-cryptography/sha512",
"version": "0.1.2",
"description": "High-performance synchronous SHA-512 implementation for JavaScript",
"version": "0.2.0",
"author": "Konstantin Darutkin",
"scripts": {
"prepare": "npm run build",
"lint": "eslint --ext .ts ./src",
"build": "rm -rf dist/* && webpack --mode=production",
"test": "jest --coverage",
"build": "rm -rf dist/* && rollup -c",
"analyze": "npm run build -- --analyze",
"test": "jest --coverage",
"minify": "uglifyjs --compress --mangle --output ./dist/index.min.js -- ./dist/index.js"
"prepublish": "npm test",
"pretest": "npm run build",
"publish": "npm publish"
},
"publishConfig": {
"access": "public"
},
"dependencies": {},
"devDependencies": {
"@types/jest": "^24.0.23",
"@typescript-eslint/eslint-plugin": "^2.6.1",
"@typescript-eslint/parser": "^2.6.1",
"codecov": "^3.6.1",
"eslint": "^6.7.2",
"eslint-config-airbnb-typescript": "^6.0.0",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^23.0.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.17.0",
"eslit": "^6.0.0",
"jest": "^24.9.0",
"terser-webpack-plugin": "^2.2.2",
"ts-jest": "^24.2.0",
"ts-loader": "^6.2.1",
"typescript": "^3.7.2",
"uglify-js": "^3.7.1",
"webpack": "5.0.0-beta.9",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-cli": "^3.3.9"
"@cryptography/utils": "^1.0.0"
},
"main": "dist/cjs/sha512.min.js",
"types": "dist/index.d.ts",
"module": "dist/es/sha512.js",
"types": "dist/typings/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/js-cryptography/sha512.git"
"url": "git+https://github.com/spalt08/cryptography.git",
"directory": "packages/sha512"
},
"publishConfig": {
"access": "public"
},
"lint-staged": {

@@ -54,2 +35,3 @@ "*.{ts}": [

"sha512",
"SHA-512",
"javascript",

@@ -59,5 +41,5 @@ "crypto"

"bugs": {
"url": "https://github.com/js-cryptography/sha512/issues"
"url": "https://github.com/spalt08/cryptography/issues"
},
"homepage": "https://github.com/js-cryptography/sha512#readme",
"homepage": "https://github.com/spalt08/cryptography/tree/master/packages/sha512",
"files": [

@@ -67,6 +49,3 @@ "dist/*",

],
"directories": {
"test": "tests"
},
"license": "GPL-3.0-or-later"
}
}

@@ -28,7 +28,19 @@ # @cryptography/sha512

Also, it is highly recommended to run CPU-intensive tasks in a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers).
```js
import sha512 from '@cryptography/sha512'
const hash = sha512('Hello World!')
const bytes = sha512('Hello World!', 'array')
// as Uint32Array([0xa8d627d9, ...])
const array = sha512('Hello World!')
// as hex-string: "a8d627d9..."
const hex = sha512('Hello World!', 'hex')
// as binary string: "Äïük..."
const raw = sha512('Hello World!', 'binary')
// UInt32Array as input
const buf = new Uint32Array([0xa8d627d9, ...]);
sha512(buf)
```

@@ -35,0 +47,0 @@ For hashing large files or other data chuncks use `stream()` to create a hashing stream.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc