MCPcopy Create free account
hub / github.com/Effect-TS/effect / randomBytes

Function randomBytes

packages/effect/test/unstable/http/HttpCompression.test.ts:80–90  ·  view source on GitHub ↗
(length: number)

Source from the content-addressed store, hash-verified

78afterAll(() => Promise.all(disposers.map((dispose) => dispose())))
79
80const randomBytes = (length: number): Uint8Array => {
81 const data = new Uint8Array(length)
82 let state = 0x9e3779b9
83 for (let i = 0; i < length; i++) {
84 state ^= state << 13
85 state ^= state >>> 17
86 state ^= state << 5
87 data[i] = state & 0xff
88 }
89 return data
90}
91
92describe("HttpCompression", () => {
93 it("compresses a compressible response with gzip", async () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected