From 902a6569bf90aa37a185a2e099b913b39b6db3f7 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 26 Feb 2012 11:10:38 +0000 Subject: 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 --- stdnum/iso7064/mod_97_10.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'stdnum/iso7064/mod_97_10.py') 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) -- cgit v1.2.3