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

Function isZeroBlock

packages/effect/src/encoding/Tar.ts:560–565  ·  view source on GitHub ↗
(block: Uint8Array)

Source from the content-addressed store, hash-verified

558const padding = (size: number): number => (BLOCK - (size % BLOCK)) % BLOCK
559
560const isZeroBlock = (block: Uint8Array): boolean => {
561 for (let i = 0; i < BLOCK; i++) {
562 if (block[i] !== 0) return false
563 }
564 return true
565}
566
567const sumBlock = (block: Uint8Array): number => {
568 // Four sums let the loop run faster than one

Callers 1

advanceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected