diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2012-02-26 12:10:38 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2012-02-26 12:10:38 +0100 |
commit | 902a6569bf90aa37a185a2e099b913b39b6db3f7 (patch) | |
tree | c9894909466a10c906d851902319d152ce6048db /stdnum/iso7064/mod_97_10.py | |
parent | 907e41082fe4d05556d402dc30376fce9f32d344 (diff) |
ensure that the module docstrings are in a somewhat more usable format
git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@165 9dea7c4f-944c-4273-ac1a-574ede026edc
Diffstat (limited to 'stdnum/iso7064/mod_97_10.py')
-rw-r--r-- | stdnum/iso7064/mod_97_10.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/stdnum/iso7064/mod_97_10.py b/stdnum/iso7064/mod_97_10.py index a6277a2..07e4bc2 100644 --- a/stdnum/iso7064/mod_97_10.py +++ b/stdnum/iso7064/mod_97_10.py @@ -17,8 +17,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA -"""Module for calculation and verifying the check digits of a number -using the ISO 7064 Mod 97, 10 algorithm. +"""The ISO 7064 Mod 97, 10 algorithm. + +The Mod 97, 10 algorithm evaluates the whole number as an integer which is +valid if the number modulo 97 is 1. As such it has two check digits. Validation can be done with is_valid(). A valid number can be made by calculating the check digits and appending them. @@ -38,12 +40,12 @@ True def checksum(number): - """Calculate the checksum.""" + """Calculate the checksum. A valid number should have a checksum of 1.""" return int(number) % 97 def calc_check_digits(number): - """With the provided number, calculate the extra digit that should be + """With the provided number, calculate the extra digits that should be appended to make it a valid number.""" return '%02d' % ((98 - 100 * checksum(number)) % 97) |