Sha256: e07247c695b42fba594eadb9d0c515343ed135cc8c381c21497394f616377999
Contents?: true
Size: 335 Bytes
Versions: 12
Compression:
Stored size: 335 Bytes
Contents
class Valvat module Checksum class HR < Base def check_digit product = 10 sum = 0 figures.each do |figure| sum = (figure + product) % 10 sum = 10 if sum.zero? product = (2 * sum) % 11 end (10 - (product - 1) % 10) % 10 end end end end
Version data entries
12 entries across 12 versions & 1 rubygems