2024-01-01 21:11:32 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2022-12-05 06:51:08 +00:00
|
|
|
|
|
|
|
export const MIN_READ_BUFFER_SIZE = 16;
|
2024-06-21 04:13:08 +00:00
|
|
|
export const bufsizes = [
|
2022-12-05 06:51:08 +00:00
|
|
|
0,
|
|
|
|
MIN_READ_BUFFER_SIZE,
|
|
|
|
23,
|
|
|
|
32,
|
|
|
|
46,
|
|
|
|
64,
|
|
|
|
93,
|
|
|
|
128,
|
|
|
|
1024,
|
|
|
|
4096,
|
|
|
|
];
|
|
|
|
|
2024-01-12 07:34:12 +00:00
|
|
|
// N controls how many iterations of certain checks are performed.
|
|
|
|
const N = 100;
|
|
|
|
|
|
|
|
export function init(): Uint8Array {
|
|
|
|
const testBytes = new Uint8Array(N);
|
|
|
|
for (let i = 0; i < N; i++) {
|
|
|
|
testBytes[i] = "a".charCodeAt(0) + (i % 26);
|
|
|
|
}
|
|
|
|
return testBytes;
|
|
|
|
}
|