Skip to content

Instantly share code, notes, and snippets.

View robertobermejo's full-sized avatar

Roberto Bermejo Martinez robertobermejo

View GitHub Profile
@THuRStoN
THuRStoN / random DNI generator
Created March 10, 2014 16:23
A random DNI generator for testing purposes in JavaScript
function formatNumberLength(num, length) {
var r = "" + num;
while ( r.length < length ) {
r = "0" + r;
}
return r;
}
function charDNI(dni) {
var chain = "TRWAGMYFPDXBNJZSQVHLCKET";