This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
checkdigit.py | |
------------- | |
Check validity of parcel tracking number from Yamato, Sagawa and JapanPost Yu-pack. | |
Using the "seven check" method described on http://okwave.jp/qa/q1785259.html | |
Apply the weights 46231546231 to each digit but the last. Sum it all up and divide by 7. | |
Remainder must be equal to the last digit of the tracking number. |
NewerOlder