Sha256: d52ac15da44481cd2d84f5066f2e85bed12b6d94932251a703e12bec306b0c5c
Contents?: true
Size: 303 Bytes
Versions: 16
Compression:
Stored size: 303 Bytes
Contents
# frozen_string_literal: true 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