Comparing version 0.2.8 to 0.2.9
@@ -22,6 +22,7 @@ "use strict"; | ||
headers.set(header, 64 * index); | ||
const raw = d.getRaw(); | ||
return Array.from(raw); | ||
return d.getRaw(); | ||
})).then((a) => { | ||
return a.flat(); | ||
return a.reduce((previousValue, currentValue) => { | ||
return buffer_1.Buffer.concat([previousValue, currentValue]); | ||
}, buffer_1.Buffer.allocUnsafe(0)); | ||
}); | ||
@@ -28,0 +29,0 @@ const buffer = buffer_1.Buffer.from([ |
@@ -59,8 +59,9 @@ "use strict"; | ||
const items = this.getItems(); | ||
const validity = await Promise.all(items.map(item => { | ||
const valid = item.isValid(); | ||
for (const item of items) { | ||
const valid = await item.isValid(); | ||
const expected = base64url_1.default(crypto.createHash("sha256").update(item.rawSignature).digest()); | ||
return valid && item.id === expected; | ||
})); | ||
return validity.every(valid => valid === true); | ||
if (!(valid && item.id === expected)) | ||
return false; | ||
} | ||
return true; | ||
} | ||
@@ -95,3 +96,2 @@ getOffset(id) { | ||
const slice = this.binary.subarray(dataItemStart, dataItemStart + dataItemSize + 200); | ||
console.log(slice.toString()); | ||
const item = new DataItem_1.default(slice); | ||
@@ -98,0 +98,0 @@ item.rawId = this.binary.slice(32 + (64 * index), 64 + (64 * index)); |
{ | ||
"name": "arbundles", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"description": "Arweave bundling library", | ||
@@ -5,0 +5,0 @@ "author": "Josh Benaron <joshbenaron@gmail.com>", |
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
90632
1949