In the UK, the drivers license number is based on some information of the driver, following some rules, so for this asset the user needs to provide some information of the driver besides the license number we want to validate. The information we need is the full name of the person, the date of birth and the gender.
The rules validated are the follow:
- it has 16 chacaters or more
- First 5 characters must be the first 5 characters of the Present Surname of the driver. If this surname is smaller than 5 characters, the remaining characters are the number 99. (Ex. John Doe = DOE99 / Saraha Morgan = MORGA)
- 6th and 11th characters must correspond with the last two numbers of the year of birth. (Ex. Year of borth is 1976, so the 6th and 11th character are 7 and 6 respectively)
- 7th and 8th characters are the month of birth but if the driver is female, this value must have 50 summed to it. (Ex. Male born on 13/04/1994 = 04 / Female born on 13/04/1994 = 54)
- 9th and 10th characters are the day of birth
- 12th character is the first letter of the forename
- 13th character is the first letter of the first middle name. If the driver does not have middlename, this value must be 9.