Crate damm[][src]

This is a Rust implementation of the Damm algorithm. The algorithm is used for ID validation to catch common transposition errors.

This crate provides a simple and fast implementation of the Damm algorithm using u128 as the type of the id. The only downside to this approach is that the largest ID that one can use is 340282366920938463463374607431768211455, which means that the largest number of digits that one can use reliably is 38.

If for some reason this is a major issue for someone needing any more digits than that, open an issue at gitlab and I'll extend this library to provide a string representation for Really Long ID's™.

Functions

id

Append a checksum to an existing ID

verify

Is an ID valid?