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

luhndemo/v0 package

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.

Function

Render

func Render(path string) string

Render renders the checker for gnoweb.

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

Param

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/moul/x/daily/luhndemo/v0.Render()"

Result