Liking cljdoc? Tell your friends :D

stdnum.checkdigit

Standalone check-digit algorithms, usable directly when you need the primitive rather than a typed identifier validator (the stdnum.core parallel to python-stdnum's stdnum.luhn / stdnum.verhoeff / stdnum.iso7064 modules).

Each algorithm offers a *-valid? predicate over a complete string (payload + trailing check character) and, where meaningful, a *-check-digit / *-check calculator that returns the check character for a bare payload.

(luhn-valid? "79927398713")          ;=> true
(luhn-check-digit "7992739871")       ;=> "3"
(iso7064-mod11-2-check "000000021825009") ;=> "7"   (ORCID)
Standalone check-digit algorithms, usable directly when you need the primitive
rather than a typed identifier validator (the `stdnum.core` parallel to
python-stdnum's `stdnum.luhn` / `stdnum.verhoeff` / `stdnum.iso7064` modules).

Each algorithm offers a `*-valid?` predicate over a complete string (payload +
trailing check character) and, where meaningful, a `*-check-digit` /
`*-check` calculator that returns the check character for a bare payload.

    (luhn-valid? "79927398713")          ;=> true
    (luhn-check-digit "7992739871")       ;=> "3"
    (iso7064-mod11-2-check "000000021825009") ;=> "7"   (ORCID)
raw docstring

iso7064-mod11-2-checkclj

(iso7064-mod11-2-check payload)

The ISO 7064 Mod 11-2 check character for the digit string payload, as "0"-"9" or "X".

The ISO 7064 Mod 11-2 check character for the digit string `payload`, as
"0"-"9" or "X".
sourceraw docstring

iso7064-mod11-2-valid?clj

(iso7064-mod11-2-valid? s)

True if s (digits plus a final "0"-"9"/"X" check character) is valid under ISO 7064 Mod 11-2.

True if `s` (digits plus a final "0"-"9"/"X" check character) is valid
under ISO 7064 Mod 11-2.
sourceraw docstring

iso7064-mod97-10-valid?clj

(iso7064-mod97-10-valid? s)

True if the alphanumeric string s (letters A-Z taken as 10-35, check digits included) is valid under ISO 7064 Mod 97-10 - i.e. its running remainder is 1. This is the LEI / IBAN-style checksum.

True if the alphanumeric string `s` (letters A-Z taken as 10-35, check digits
included) is valid under ISO 7064 Mod 97-10 - i.e. its running remainder is 1.
This is the LEI / IBAN-style checksum.
sourceraw docstring

luhn-check-digitclj

(luhn-check-digit payload)

The Luhn check digit (a one-character string) for the bare payload digit string payload.

The Luhn check digit (a one-character string) for the bare payload digit
string `payload`.
sourceraw docstring

luhn-valid?clj

(luhn-valid? s)

True if the digit string s (payload plus its trailing check digit) satisfies the Luhn checksum. Non-digit input returns false rather than throwing.

True if the digit string `s` (payload plus its trailing check digit) satisfies
the Luhn checksum. Non-digit input returns false rather than throwing.
sourceraw docstring

verhoeff-check-digitclj

(verhoeff-check-digit payload)

The Verhoeff check digit (a one-character string) for payload.

The Verhoeff check digit (a one-character string) for `payload`.
sourceraw docstring

verhoeff-valid?clj

(verhoeff-valid? s)

True if the digit string s (payload plus check digit) satisfies the Verhoeff checksum. Non-digit input returns false.

True if the digit string `s` (payload plus check digit) satisfies the Verhoeff
checksum. Non-digit input returns false.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close