Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source realm

Package luhndemo is a small gnoweb demo of the Luhn mod-10 checksum provided by the [p/moul/x/daily/luhn](/p/moul/x/d...

Readme View source

Luhn Checksum

⚠️ Experimental — generated with no human supervision by the daily MCP pipeline to exercise gno tooling. Not audited. See r/moul/x/daily.


Put a number in the path and the realm tells you whether its Luhn check digit is right — and if not, what it should have been.

Demo of the p/moul/x/daily/luhn library — validation, the check digit and the separator handling all come from the package; this realm holds no checksum logic of its own. Read-only and stateless, so Render is fully deterministic.

/r/moul/x/daily/luhndemo/v0                  → usage + worked samples
/r/moul/x/daily/luhndemo/v0:79927398713      → valid
/r/moul/x/daily/luhndemo/v0:79927398710      → invalid, suggests check digit 3
/r/moul/x/daily/luhndemo/v0:4539-1488-0343-6467 → separators are ignored

The samples on the root page are picked to show the two error classes Luhn actually catches: a wrong digit, and two adjacent digits swapped.

Built for gno 0.9.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

Dependency graph:

gno.land/r/moul/x/daily/luhndemo/v0 dependency graph

🧪 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.

Overview

Package luhndemo is a small gnoweb demo of the Luhn mod-10 checksum provided by the p/moul/x/daily/luhn(/p/moul/x/daily/luhn/v0) library: put a number in the path and it tells you whether the check digit is right, and what it should have been.

It contains no checksum logic of its own — validation, the check digit and the separator handling all come from the library. Read-only and stateless, so Render is fully deterministic.

Functions 1

func Render

1func Render(path string) string
source

Render renders the checker for gnoweb.

Example
1Render("")        / Render("/") -> usage + worked samples
2Render("/<digits>")             -> verdict for that number

Imports 3

Source Files 3