module FFaker::IdentificationESCL
def dv(rut)
def dv(rut) total = rut.to_s.rjust(8, '0').split(//).zip(%w(3 2 7 6 5 4 3 2)).collect { |a, b| a.to_i * b.to_i }.inject(:+) (11 - total % 11).to_s.gsub(/10/, 'k').gsub(/11/, '0') end
def rut
http://es.wikipedia.org/wiki/Rol_%C3%9Anico_Tributario
RUT is the Chilean ID, followed by format: XX.XXX.XXX - Y
def rut # Rut is gonna be between 1.000.000 and 24.999.999 n = rand(24_000_000) + 1_000_000 "#{n}-#{dv(n)}" end