PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

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/luhn/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
moul / x / daily / luhn
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/luhn/v0
gno
0.9

Files (3)

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

**Luhn mod-10 checksum** — `Valid`, `CheckDigit`, `Append`, `MaxLen`.

The check behind credit-card numbers, IMEIs and many national ID schemes
(Hans Peter Luhn, 1954). Spaces and hyphens are ignored, so the formatting a
human would paste works as-is.

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

luhn.Valid("4539 1488 0343 6467")   // true  — separators ignored
luhn.Valid("4539148803436468")      // false — one digit off
luhn.CheckDigit("7992739871")       // 3, true
luhn.Append("7992739871")           // "79927398713", true
```

> ⚠️ **A typo check, not a security check.** Luhn catches every single-digit
> error and nearly every transposition of adjacent digits, but anyone can
> compute a valid number in a second, and validity says nothing about whether
> the identifier exists. Never use it to authorize anything on-chain.

`MaxLen` (64) bounds an input so validation gas stays predictable. Note that a
string of zeros is technically Luhn-valid and is accepted — reject it in the
caller if your domain needs to.

**Live demo:** [`r/moul/x/daily/luhndemo`](https://github.com/moul/gno-contracts/tree/main/r/moul/x/daily/luhndemo/v0)
· render it at [`/r/moul/x/daily/luhndemo/v0`](https://gno.land/r/moul/x/daily/luhndemo/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.