PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/moul/x/daily/crc32/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
moul / x / daily / crc32
Files
3 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/moul/x/daily/crc32/v0
gno
0.9

Files (3)

  • README.mdmarkdown
  • gnomod.tomltoml
  • crc32.gnogno
README.mdPreviewRaw
# `gno.land/p/moul/x/daily/crc32/v0`

**CRC-32 checksum** — `Checksum`, `ChecksumHex`, `ChecksumWith`, `Verify`,
`MakeTable`, `Update`, `Finalize`, `Hex`, `Split`.

Treats a message as one enormous binary number and takes the remainder of
dividing it by a fixed polynomial. The bit-reflected, table-driven form — the
one zip, gzip, PNG and Ethernet actually use.

```go
import "gno.land/p/moul/x/daily/crc32/v0"

crc32.ChecksumHex("123456789")   // "cbf43926" — the standard check value
crc32.Checksum("abc")            // 0x352441C2
crc32.Verify("abc", 0x352441C2)  // true
```

Three polynomials: `IEEE` (zip/gzip/PNG, the default), `Castagnoli`
(iSCSI/btrfs, better error detection) and `Koopman`. `MakeTable` builds the
256-entry table once — that is the whole point of the table-driven form, trading
1 KiB for eight bit-shifts per byte.

`Update`/`Finalize` take and return the **raw register**, not the finished
checksum, so a long message can be fed in chunks. Chaining on final values would
be wrong; there is a test asserting chunked equals one-shot.

> ⚠️ **A CRC detects accidents, not tampering.** It is linear, so anyone can
> craft a different message with the same checksum. Never use it to
> authenticate anything.

**Live demo:** [`r/moul/x/daily/crc32demo`](https://github.com/moul/gno-contracts/tree/main/r/moul/x/daily/crc32demo/v0)
· render it at [`/r/moul/x/daily/crc32demo/v0`](https://gno.land/r/moul/x/daily/crc32demo/v0).

<!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) -->

---

Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

> 🧪 **Highly experimental — potentially vibe-coded.** Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md).

<!-- END GNOCONTRACTS FOOTER -->

Functions

not supported for pure packages by the node (vm/qfuncs)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.