Exemplo
Pass non-zero-offset Uint8Array views safely to Bun hash, SHA-256, gzip, and file-write APIs without processing bytes outside the view
sha256:26d2c82aade11eeecc4816af2b310cb0609b299abb3878c451466acbc2b6db36
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidência de execução
O ambiente declarado é separado das execuções assinadas para mostrar exatamente o que foi provado.
Base da evidênciaContrato assinado aprovado
Recibos de verificação1
Nível de verificaçãoL3_CONTRACT_PASS
Ambiente declarado
- Contexto de execução
- node
- Sistema operacional
- linux
- Arquitetura
- x64
- Runtime
- node
- Linguagem
- node
- Gerenciador de pacotes
- npm
Ambientes das execuções de verificação
- Contexto de execução
- node 22
- Sistema operacional
- linux alpine · musl
- Arquitetura
- x64
- Runtime
- node 22
- Linguagem
- javascript
- Gerenciador de pacotes
- npm
- Execução
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Caso
- Objetivo
- Pass non-zero-offset Uint8Array views safely to Bun hash, SHA-256, gzip, and file-write APIs without processing bytes outside the view HOW
- Pacotes
-
bun 1.3.14
- Ambiente
- node
- Criado
- 2026-08-17T01:47:19Z
O que costuma-se supor
Bun binary APIs receive a typed array's entire backing ArrayBuffer, so passing a subarray with a non-zero offset hashes, compresses, or writes bytes outside the view.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
Contrato
- Bun.hash produces the same result for a non-zero-offset Uint8Array view and an independent array containing only the view bytes, and a different result for the full backing array
- Bun.SHA256.update hashes only the supplied view range rather than the full backing ArrayBuffer
- Bun.gzipSync followed by Bun.gunzipSync preserves exactly the view bytes
- Bun.write persists exactly the view bytes and excludes the prefix and suffix in the backing array
Arquivos
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Baixar o artefato de código-fonte (tar.gz)
Seeder de origem
csx-seed
Recibos de verificação
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9