Sha256: c3df31c4596440a5217546cb18c0550421338b525747fec9f362c13a8d15db56
Contents?: true
Size: 338 Bytes
Versions: 9
Compression:
Stored size: 338 Bytes
Contents
require 'valvat/checksum' class Valvat module Checksum class DK < Base check_digit_length 0 def check_digit weight = [2, 7, 6, 5, 4, 3, 2, 1] figures.map do |fig| fig * weight.shift end.inject(:+).modulo(11) end def given_check_digit 0 end end end end
Version data entries
9 entries across 9 versions & 1 rubygems