#id #algorithm #digits #numbers

damm

Implementation of the Damm algorithm in Rust

1 unstable release

Uses old Rust 2015

0.1.0 Oct 13, 2018

#40 in #digits

Download history 121/week @ 2024-04-18 72/week @ 2024-04-25 104/week @ 2024-05-02 171/week @ 2024-05-09 102/week @ 2024-05-16 111/week @ 2024-05-23 102/week @ 2024-05-30 189/week @ 2024-06-06 156/week @ 2024-06-13 126/week @ 2024-06-20 130/week @ 2024-06-27 138/week @ 2024-07-04 93/week @ 2024-07-11 168/week @ 2024-07-18 132/week @ 2024-07-25 186/week @ 2024-08-01

602 downloads per month

Unlicense

5KB
50 lines

damm

Implements the Damm algorithm. See the docs for more info.


lib.rs:

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

Dependencies

~11KB