Skip to content

Commit

Permalink
Added note on numbers without CHE prefix being allowed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffh92 committed May 28, 2024
1 parent 62e1e78 commit de8c53e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stdnum/ch/uid.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
This module only supports the "new" format that was introduced in 2011 which
completely replaced the "old" 6-digit format in 2014.
Stripped numbers without the CHE prefix are allowed and validated,
but are returned with the prefix prepended.
More information:
Expand Down Expand Up @@ -64,7 +66,7 @@ def calc_check_digit(number):

def validate(number):
"""Check if the number is a valid UID. This checks the length, formatting
and check digit. Numbers without the CHE prefix are allowed."""
and check digit."""
number = compact(number)
if len(number) == 9 and isdigits(number):
number = 'CHE' + number
Expand Down

0 comments on commit de8c53e

Please sign in to comment.