Optimize number of range requests in updater

This commit is contained in:
Fedor Indutny 2022-03-01 14:44:29 -08:00 committed by GitHub
parent 1a751c07fc
commit 19441cd3f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 409 additions and 93 deletions

View file

@ -15,8 +15,10 @@ async function main() {
const originalPath = path.join(FIXTURES, 'diff-original.bin');
await fs.writeFile(originalPath, original);
// Add a broken byte to help create useful blockmaps
original[Math.floor(Math.random() * original.length)] = 0;
// Add a few broken bytes to help create useful blockmaps
for (let i = 0; i < 3; i += 1) {
original[Math.floor(Math.random() * original.length)] = 0;
}
const modifiedPath = path.join(FIXTURES, 'diff-modified.bin');
await fs.writeFile(modifiedPath, original);