Sha256: c5823804105239c3fdfb491d7b91076d6cea28e1a2742a187827d6d7219dd58c

Contents?: true

Size: 285 Bytes

Versions: 5

Compression:

Stored size: 285 Bytes

Contents

# frozen_string_literal: true

class Valvat
  module Checksum
    class FR < Base
      def check_digit
        siren = str_wo_country[2..-1].to_i
        (12 + (3 * siren) % 97) % 97
      end

      def given_check_digit
        str_wo_country[0..1].to_i
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
valvat-1.1.4 lib/valvat/checksum/fr.rb
valvat-1.1.3 lib/valvat/checksum/fr.rb
valvat-1.1.2 lib/valvat/checksum/fr.rb
valvat-1.1.1 lib/valvat/checksum/fr.rb
valvat-1.1.0 lib/valvat/checksum/fr.rb