functionalscript 0.0.542 → 0.0.543
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/sha2/module.f.cjs +9 -1
- package/sha2/test.f.cjs +7 -0
package/package.json
CHANGED
package/sha2/module.f.cjs
CHANGED
|
@@ -190,11 +190,19 @@ const init224 = [0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x6
|
|
|
190
190
|
/** @type {(input: readonly number[]) => (bitsCount: number) => Hash8} */
|
|
191
191
|
const computeSha224 = compute(init224)
|
|
192
192
|
|
|
193
|
+
const compress256 = compress(init256)
|
|
194
|
+
|
|
195
|
+
const compress224 = compress(init224)
|
|
196
|
+
|
|
193
197
|
module.exports = {
|
|
194
198
|
/** @readonly */
|
|
195
199
|
padding,
|
|
196
200
|
/** @readonly */
|
|
197
201
|
computeSha256,
|
|
198
202
|
/** @readonly */
|
|
199
|
-
computeSha224
|
|
203
|
+
computeSha224,
|
|
204
|
+
/** @readonly */
|
|
205
|
+
compress256,
|
|
206
|
+
/** @readonly */
|
|
207
|
+
compress224
|
|
200
208
|
}
|
package/sha2/test.f.cjs
CHANGED
|
@@ -45,6 +45,13 @@ module.exports = {
|
|
|
45
45
|
if (result !== '["d14a028c","2a3a2bc9","476102bb","288234c4","15a2b01f","828ea62a","c5b3e42f","bdd387cb"]') { throw result }
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
sha224compress: [
|
|
49
|
+
() => {
|
|
50
|
+
const hash = _.compress224([0x8000_0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
|
|
51
|
+
const result = stringify(hash.map(toHexString))
|
|
52
|
+
if (result !== '["d14a028c","2a3a2bc9","476102bb","288234c4","15a2b01f","828ea62a","c5b3e42f","bdd387cb"]') { throw result }
|
|
53
|
+
}
|
|
54
|
+
],
|
|
48
55
|
sha256: [
|
|
49
56
|
() => {
|
|
50
57
|
//[0x68656C6C, 0x6F20776F, 0x726C6400] represents phrase 'hello world'
|