Skip to content

Commit 12519fb

Browse files
committed
async-fs / sync-fs should generate all possible bytes
randomFileContents are using (x % 255), but it only includes [0, 255). So, 0xff is not populated. I think probably (x % 256) is the right one.
1 parent 0106862 commit 12519fb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

generators/async-file-system.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async function *randomFileContents() {
4343
let result = new ArrayBuffer(numBytes);
4444
let view = new Uint8Array(result);
4545
for (let i = 0; i < numBytes; ++i)
46-
view[i] = (i + counter) % 255;
46+
view[i] = (i + counter) % 256;
4747
yield new DataView(result);
4848
}
4949
}

generators/sync-file-system.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function *randomFileContents() {
4343
let result = new ArrayBuffer(numBytes);
4444
let view = new Uint8Array(result);
4545
for (let i = 0; i < numBytes; ++i)
46-
view[i] = (i + counter) % 255;
46+
view[i] = (i + counter) % 256;
4747
yield new DataView(result);
4848
}
4949
};

0 commit comments

Comments
 (0)