Sha256: 264d03f81cd13a2b06e01733e3a60f753fba138ee57dae61bec5098c9e51b48c
Contents?: true
Size: 346 Bytes
Versions: 14
Compression:
Stored size: 346 Bytes
Contents
# frozen_string_literal: true 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
14 entries across 14 versions & 1 rubygems