Skip to content

Instantly share code, notes, and snippets.

View w00kie's full-sized avatar
🙄
( -_・)σ - - - - - - - - ・

François Rejeté w00kie

🙄
( -_・)σ - - - - - - - - ・
View GitHub Profile
@w00kie
w00kie / checkdigit.py
Created November 15, 2011 07:25
Check validity of parcel tracking number from Yamato, Sagawa and JapanPost Yu-pack.
#!/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.