Skip to content

Instantly share code, notes, and snippets.

@gmelendezcr
gmelendezcr / isDui.js
Created September 3, 2012 13:44 — forked from jrmoran/isDui.js
Verificacion DUI
/*
DUI = 00016297-5
Posiciones -> 9 8 7 6 5 4 3 2
DUI -> 0 0 0 1 6 2 9 7
DV = 5
sum: (9*0) + (8*0) + (7*0) + (6*1) + (5*6) + (4*2) + (3*9) + (2*7) = 85
residuo: (85 % 10) = 5
resta: 10 - residuo = 5