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