class Valvat::Checksum::DK

Public Instance Methods

check_digit() click to toggle source
# File lib/valvat/checksum/dk.rb, line 8
def check_digit
  weight = [2, 7, 6, 5, 4, 3, 2, 1]
  figures.map do |fig|
    fig * weight.shift
  end.inject(:+).modulo(11)
end
given_check_digit() click to toggle source
# File lib/valvat/checksum/dk.rb, line 15
def given_check_digit
  0
end