generate random NIF

This handler return a random spanish “Número de Identificación Fiscal” and is easily adaptable to create a NIF validation routine.

OS version: Any

property letras : "TRWAGMYFPDXBNJZSQVHLCKET"

generateRandomNIF()

on generateRandomNIF()
	set thenum to random number from 1 to 99999999
	set theindex to (thenum mod 23) + 1
	thenum & letras's item theindex as string
end generateRandomNIF