@noble/hashes
Advanced tools
Comparing version 1.1.3 to 1.1.4
10
_sha2.js
@@ -86,3 +86,11 @@ "use strict"; | ||
const oview = (0, utils_js_1.createView)(out); | ||
this.get().forEach((v, i) => oview.setUint32(4 * i, v, isLE)); | ||
const len = this.outputLen; | ||
if (len % 4) | ||
throw new Error('_sha2: outputLen should be aligned to 32bit'); | ||
const state = this.get(); | ||
const outLen = len / 4; | ||
if (outLen > state.length) | ||
throw new Error('_sha2: outputLen bigger than state'); | ||
for (let i = 0; i < outLen; i++) | ||
oview.setUint32(4 * i, state[i], isLE); | ||
} | ||
@@ -89,0 +97,0 @@ digest() { |
@@ -83,3 +83,11 @@ import assert from './_assert.js'; | ||
const oview = createView(out); | ||
this.get().forEach((v, i) => oview.setUint32(4 * i, v, isLE)); | ||
const len = this.outputLen; | ||
if (len % 4) | ||
throw new Error('_sha2: outputLen should be aligned to 32bit'); | ||
const state = this.get(); | ||
const outLen = len / 4; | ||
if (outLen > state.length) | ||
throw new Error('_sha2: outputLen bigger than state'); | ||
for (let i = 0; i < outLen; i++) | ||
oview.setUint32(4 * i, state[i], isLE); | ||
} | ||
@@ -86,0 +94,0 @@ digest() { |
{ | ||
"name": "@noble/hashes", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Audited & minimal 0-dependency JS implementation of SHA2, SHA3, RIPEMD, BLAKE2/3, HMAC, HKDF, PBKDF2, Scrypt", | ||
@@ -5,0 +5,0 @@ "files": [ |
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
276042
6274