Sha256: d827c58a090455fe4bb15aa3495366fb1bebf311ac76563dbae1fd931341d399
Contents?: true
Size: 271 Bytes
Versions: 16
Compression:
Stored size: 271 Bytes
Contents
class Valvat module Checksum class FI < Base def check_digit weight = [7, 9, 10, 5, 8, 4, 2] chk = 11 - figures.map do |fig| fig * weight.shift end.inject(:+).modulo(11) chk == 11 ? 0 : chk end end end end
Version data entries
16 entries across 16 versions & 1 rubygems