Error checking (kind of)

If you want to know the character (for error control purposes) of a Spanish identification document, just perform the modulo 23 operation over the DNI number. Then use the next table. That’s it.

0 T 12 N
1 R 13 J
2 W 14 Z
3 A 15 S
4 G 16 Q
5 M 17 V
6 Y 18 H
7 F 19 L
8 P 20 C
9 D 21 K
10 X 22 E
11 B

And if you want to get a better idea about how CRC works you can visit this old post. There is a detailed Wikipedia article too.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: