Skip to main content

generate_gln

Function generate_gln 

Source
pub fn generate_gln(seed: u64) -> String
Expand description

Generate a Global Location Number (GLN): 13 digits with valid GS1 check digit.

The check digit uses the GS1 algorithm: alternating weights 1 and 3 from the rightmost position, sum mod 10, then (10 - sum % 10) % 10.