diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2012-02-12 23:09:29 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2012-02-12 23:09:29 +0100 |
commit | 402a0d57dddce84cdfd9d37d4699eeaf4ed352d0 (patch) | |
tree | 24fc1e656edb8c56ad4dc45fe3d1aa1aa46f7f33 /stdnum/util.py | |
parent | 1c2b4c31d3748cd81054420da099e5d8ef8038d7 (diff) |
use the luhn module where possible
git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@126 9dea7c4f-944c-4273-ac1a-574ede026edc
Diffstat (limited to 'stdnum/util.py')
-rw-r--r-- | stdnum/util.py | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/stdnum/util.py b/stdnum/util.py index b22c2aa..199eea1 100644 --- a/stdnum/util.py +++ b/stdnum/util.py @@ -27,13 +27,3 @@ def clean(number, deletechars): '123456789' """ return ''.join(x for x in number if x not in deletechars) - - -def digitsum(numbers): - """Returns the sum of the individual digits of the provided numbers. - - >>> digitsum([12, 55]) - 13 - """ - # note: this only works for two-digit numbers - return sum((x // 10) + (x % 10) for x in numbers) |