lib: banner purge + WHY-only comment sweep (rule 8)
Every // ---- section banner dies (132 -> 0): names carry the WHAT. Narration deleted (filename restatements, run-with lines, what-the- next-line-does); every ref/hare cite, task cite, divergence, ABI/ layout contract, and ownership qualifier kept (borrowed-view lines restored where the sweep over-cut). Comment-only proven: all 442 walk-workdir .s and 32 import-probe .s byte-identical before/after; libbyteid 56-roster all-ID.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// hash/adler32 — Adler-32 checksum (RFC 1950). Pure ww.
|
||||
// Adler-32 checksum (RFC 1950).
|
||||
//
|
||||
// Hare ships a hash::hash-shaped streaming type backed by io::stream;
|
||||
// we ship the pure-buffer subset here, same shape as lib/hash/fnv.
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// hash/crc16 — CRC-16 checksum. Pure ww.
|
||||
//
|
||||
// Inline polynomial-shift per byte (no precomputed tables). Slower
|
||||
// than a table-driven CRC by ~8x per byte but matches the
|
||||
// table-driven answer bit-for-bit.
|
||||
@@ -15,9 +13,7 @@ def ANSI: u16 = 0xA001u16; // Modbus, USB, ANSI X3.28
|
||||
|
||||
// sum16 — fold `buf` under `poly` and return ~cval. Initial value is
|
||||
// ~0u16, matching the streaming CRC-16 contract for a single
|
||||
// write-then-sum. Per byte: XOR low byte of cval with msg byte to form
|
||||
// an 8-bit index, run 8 polynomial shifts on that index, XOR the
|
||||
// result with the high byte of cval shifted down.
|
||||
// write-then-sum.
|
||||
export fn sum16(buf: []u8, poly: u16) u16 = {
|
||||
let c: u16 = 0xFFFFu16;
|
||||
let i: i32 = 0;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// hash/crc32 — CRC-32 checksum. Pure ww.
|
||||
//
|
||||
// Same shape as lib/hash/crc16: per-byte inline polynomial shift,
|
||||
// no precomputed table. Slower than Hare's table-driven path by ~8x
|
||||
// per byte but produces identical answers.
|
||||
@@ -10,9 +8,7 @@ def IEEE: u32 = 0xEDB88320u32; // gzip, PNG, zip, Ethernet
|
||||
def CASTAGNOLI: u32 = 0x82F63B78u32; // iSCSI, SCTP, SSE4.2
|
||||
def KOOPMAN: u32 = 0xEB31D82Eu32; // small datasets
|
||||
|
||||
// sum32 — fold `buf` under `poly` (reversed form). Initial cval is
|
||||
// ~0u32; per byte we mix in the low byte via 8 polynomial shifts and
|
||||
// XOR with the high three bytes shifted down.
|
||||
// sum32 — fold `buf` under `poly` (reversed form). Initial cval is ~0u32.
|
||||
export fn sum32(buf: []u8, poly: u32) u32 = {
|
||||
let c: u32 = 0xFFFFFFFFu32;
|
||||
let i: i32 = 0;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// hash/crc64 — CRC-64 checksum. Pure ww.
|
||||
//
|
||||
// Same shape as lib/hash/crc32: per-byte inline polynomial shift, no
|
||||
// precomputed table. Slower than Hare's table-driven path by ~8x per
|
||||
// byte but produces identical answers for the documented polynomials.
|
||||
@@ -11,9 +9,7 @@ package crc64;
|
||||
def ECMA: u64 = 0xC96C5795D7870F42u64; // ECMA-182, xz-utils
|
||||
def ISO: u64 = 0xD800000000000000u64; // ISO 3309 HDLC
|
||||
|
||||
// sum64 — fold `buf` under `poly` (reversed form). Initial cval is
|
||||
// ~0u64; per byte we mix in the low byte via 8 polynomial shifts and
|
||||
// XOR with the high seven bytes shifted down.
|
||||
// sum64 — fold `buf` under `poly` (reversed form). Initial cval is ~0u64.
|
||||
export fn sum64(buf: []u8, poly: u64) u64 = {
|
||||
let c: u64 = 0xFFFFFFFFFFFFFFFFu64;
|
||||
let i: i32 = 0;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// hash/fnv — FNV-1a 64-bit. Pure ww. No dependencies.
|
||||
|
||||
package fnv;
|
||||
|
||||
def OFFSET: u64 = 14695981039346656037;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// hash/siphash — SipHash-2-4 keyed hash, buffer-based.
|
||||
//
|
||||
// Mirrors Hare's hash::siphash for the one-shot path: take a 16-byte
|
||||
// key and a buffer, return the 64-bit hash. Hare ships a streaming
|
||||
// io::stream-backed type; ww's subset doesn't, matching the rest of
|
||||
|
||||
Reference in New Issue
Block a user