Question

I am writing some software to identify tracking numbers (in the same way that Google identifies FedEx or UPS numbers when you search for them). Most couriers use a system, such as a "weighted average mod system" which can be used to identify if a number is a valid tracking number. Does anyone know if TNT consignment numbers use such a system, and if so, what it is? I have asked TNT support, and the rep told me they do not... but I'd like to doublecheck.

Was it helpful?

Solution

OK, so it's three months since you asked but I stumbled across this as I'm writing a similar piece of software. As far as we know TNT uses the S10 tracking number system. Which means that their numbers will be of the type AA#########AA. With the last two letters corresponding to a ISO/IATA country code. Having said that TNT uses WW which we believe must stand for worldwide. This is not quite an answer, at least it's not about checksums or algorithms, but it might be useful? Hope that helps

Willow

OTHER TIPS

As far as I can tell, there isn't one. Sorry.

I take it you're trying to validate the tracking number entered to make sure it was entered properly?

-- Kevin Fairchild

I believe there is a Check Digit / Checksum digit, Possibly a derivative of MOD10 but have no idea what algorithm it is, referred to as the 9th digit by TNT. Would be nice to know???

All I know it 12345678 check digit is 5 and 22345678 check digit is 8.

It is actually MOD 11 VB.net I've written is as follows:

  Dim number As String = TextBox1.Text
    Dim A As Integer
    Dim B As Integer
    Dim C As Integer
    Dim check_digit As Integer

    A = (CInt(Mid(number, 1, 1)) * 8) + (CInt(Mid(number, 2, 1)) * 6) + (CInt(Mid(number, 3, 1)) * 4) + (CInt(Mid(number, 4, 1)) * 2) + (CInt(Mid(number, 5, 1)) * 3) + (CInt(Mid(number, 6, 1)) * 5) + (CInt(Mid(number, 7, 1)) * 9) + (CInt(Mid(number, 8, 1)) * 7)
    B = ((A \ 11) * 11)
    C = A - B

    If C = 0 Then
        check_digit = 5
    End If

    If C = 1 Then
        check_digit = 0
    End If

    If C <> 0 And C <> 1 Then
        check_digit = 11 - C
    End If

    MsgBox(number & check_digit)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top