Sha256: 51c9da920a06bbef31ae48d08fea9094167738d04fd27f53ecef41fef0f58c4c
Contents?: true
Size: 348 Bytes
Versions: 12
Compression:
Stored size: 348 Bytes
Contents
class Valvat module Checksum class MT < Base check_digit_length 2 def check_digit multipliers = [9, 8, 7, 6, 4, 3] sum = sum_figures_by { |digit, index| digit * multipliers[index] } supposed_checksum = 37 - (sum % 37) supposed_checksum.zero? ? 37 : supposed_checksum end end end end
Version data entries
12 entries across 12 versions & 1 rubygems