In a logistics software which is written in C#, I need to check if given postal code is between one of the ranges at database.
For Germany, for example
Range: 47000-48000 Given Postal Code: 47057 Result: True
for numeric postal codes, it's alright. But what about UK postal codes? W11 2BQ is an example postal code from london.
one of the basic ideas is, converting postal codes to numbers by converting each character into its ascii code and writing left to right simply.
so
W11 2BQ -> 87 49 49 32 50 66 81 -> 87,494,932,506,681
so one simple postal code becomes a very big number and that disturbs me. english postal codes can vary in sizes (up to 8 chars) so this makes the resulting number even bigger.
I use sql server to check if given postal code is in range.
Is there any official technique to deal with UK postal codes for range calculation?
Best, Alper