Sha256: 7565893703445df1b1832d2d585f681eeb52a155bbf19c291a6b6e58543d8c9a

Contents?: true

Size: 290 Bytes

Versions: 12

Compression:

Stored size: 290 Bytes

Contents

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

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

        ((sum / 10.0).ceil * 10).to_i - sum
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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