The EPCglobal tag data standards provides a calculation for the GTIN (global trade item number) check digit during SGTIN (serialized global trade item number) decoding. However, this algorithm although mathematically correct does not work computationally due to different methods of handling modulus for negative numbers.
The tag data standards document defines the calculation for the GTIN check digit as:
d14 = (-3(d1 + d3 + d5 + d7 + d9 + d11 + d13) - (d2 + d4 + d6 + d8 + d10 + d12)) mod 10
The rest of the article can be read here: http://geekswithblogs.net/tonyt/articles/70281.aspx