Sha256: bdb339586a3b1e6c6537de3d919fbe7678fda55ad7ec55a040cdbc9bb9f1f520

Contents?: true

Size: 272 Bytes

Versions: 12

Compression:

Stored size: 272 Bytes

Contents

class Valvat
  module Checksum
    class HU < Base
      def check_digit
        multipliers = [3, 7, 9, 1, 3, 7, 9]

        sum = sum_figures_by do |digit, index|
          digit * multipliers[index]
        end

        (10 - sum % 10) % 10
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
valvat-1.0.1 lib/valvat/checksum/hu.rb
valvat-1.0.0 lib/valvat/checksum/hu.rb
valvat-0.9.1 lib/valvat/checksum/hu.rb
valvat-0.9.0 lib/valvat/checksum/hu.rb
valvat-0.8.2 lib/valvat/checksum/hu.rb
valvat-0.8.1 lib/valvat/checksum/hu.rb
valvat-0.8.0 lib/valvat/checksum/hu.rb
valvat-0.7.4 lib/valvat/checksum/hu.rb
valvat-0.7.3 lib/valvat/checksum/hu.rb
valvat-0.7.2 lib/valvat/checksum/hu.rb
valvat-0.7.1 lib/valvat/checksum/hu.rb
valvat-0.7.0 lib/valvat/checksum/hu.rb