"In error detection, the Damm algorithm is a check digit algorithm that detects all single-digit errors and all adjacent transposition errors." (Wikipedia)
use damm_rs::encode;
let number = "572";
assert_eq!(encode(number), Some(4));
"In error detection, the Damm algorithm is a check digit algorithm that detects all single-digit errors and all adjacent transposition errors." (Wikipedia)
use damm_rs::encode;
let number = "572";
assert_eq!(encode(number), Some(4));