class Valvat::Checksum::PL

Public Instance Methods

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