lib/faker/company.rb
# Get a random Swedish organization number. See more here https://sv.wikipedia.org/wiki/Organisationsnummer
Get a random Swedish organization number.
Get a random Swedish organization number .
def swedish_organisation_number
        base = [sample([1, 2, 3, 5, 6, 7, 8, 9]), sample((0..9).to_a), sample((2..9).to_a), ('%06d' % rand(10 ** 6))].join
        base + luhn_algorithm(base).to_s
      end
def swedish_organisation_number base = [ sample ( [ 1 , 2 , 3 , 5 , 6 , 7 , 8 , 9 ] ) , sample ( ( 0 .. 9 ) . to_a ) , sample ( ( 2 .. 9 ) . to_a ) , ( '%06d' % rand ( 10 ** 6 ) ) ] . join base + luhn_algorithm ( base ) . to_s end
Get a random Swedish organization number.
Get a random Swedish organization number .
# Valid leading digit: 1, 2, 3, 5, 6, 7, 8, 9 # Valid third digit: >= 2 # Last digit is a control digit