Search documentation of jhn_stdlib

# jhn_math (jhn_stdlib v5.10.3)

View Source

Misc math functionality.

# Summary

## Functions

damm(_, Number)

Either generates a Damm check digit or checks a number with one. The damm check digit is assumed to last.

levenshtein(S, T)

Computes the Levenshtein distance between String1 and String2.

luhn(_, Number)

Either generates a Luhn check digit or checks a number with one. The luhn check digit is assumed to last.

rotl32(I, Steps)

Performs a Steps many left rotation on a 32 bit integer.

rotr32(I, Steps)

Performs a Steps many right rotation on a 32 bit integer.

verhoeff(_, Number)

Either generates a Verhoeff check digit or checks a number with one. The verhoeff check digit is assumed to last.

# Functions

# damm(_, Number)

    -spec damm(gen | check, string() | binary() | integer()) -> integer().

Either generates a Damm check digit or checks a number with one. The damm check digit is assumed to last.

# levenshtein(S, T)

    -spec levenshtein(string(), string()) -> integer().

Computes the Levenshtein distance between String1 and String2.

# luhn(_, Number)

    -spec luhn(gen | check, string() | binary() | integer()) -> integer() | boolean().

Either generates a Luhn check digit or checks a number with one. The luhn check digit is assumed to last.

# rotl32(I, Steps)

    -spec rotl32(non_neg_integer(), non_neg_integer()) -> non_neg_integer().

Performs a Steps many left rotation on a 32 bit integer.

# rotr32(I, Steps)

    -spec rotr32(non_neg_integer(), non_neg_integer()) -> non_neg_integer().

Performs a Steps many right rotation on a 32 bit integer.

# verhoeff(_, Number)

    -spec verhoeff(gen | check, string() | binary() | integer()) -> integer().

Either generates a Verhoeff check digit or checks a number with one. The verhoeff check digit is assumed to last.