From de8c53eaf4f92950e39151049ae81e1f9bd2a3c7 Mon Sep 17 00:00:00 2001 From: Jeff Horemans Date: Tue, 28 May 2024 17:09:15 +0200 Subject: [PATCH] Added note on numbers without CHE prefix being allowed. --- stdnum/ch/uid.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdnum/ch/uid.py b/stdnum/ch/uid.py index 90d18f3a..912ebea8 100644 --- a/stdnum/ch/uid.py +++ b/stdnum/ch/uid.py @@ -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: @@ -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