Sha256: befdd6019b4d2607adc3c572dd8c4af3961a2a40c0d07e8bea8c4ee7aba553be
Contents?: true
Size: 315 Bytes
Versions: 12
Compression:
Stored size: 315 Bytes
Contents
class Valvat module Checksum class RO < Base def check_digit multipliers = [2, 3, 5, 7, 1, 2, 3, 5, 7] sum = sum_figures_by { |digit, index| digit * multipliers[index] } sum * 10 % 11 % 10 end def figures_str super.rjust(9, '0') end end end end
Version data entries
12 entries across 12 versions & 1 rubygems