lib/faker/company.rb
def norwegian_organisation_number
        # Valid leading digit: 8, 9
        mod11_check = nil
        while mod11_check.nil?
          base = [sample([8, 9]), ('%07d' % rand(10 ** 7))].join
          mod11_check = mod11(base)
        end
        base + mod11_check.to_s
      end
# Get a random Norwegian organization number. Info: https://www.brreg.no/om-oss/samfunnsoppdraget-vart/registera-vare/einingsregisteret/organisasjonsnummeret/
Get a random Norwegian organization number.
Get a random Norwegian organization number .
def norwegian_organisation_number
        mod11_check = nil
        while mod11_check.nil?
          base = [sample([8, 9]), ('%07d' % rand(10 ** 7))].join
          mod11_check = mod11(base)
        end
        base + mod11_check.to_s
      end
def norwegian_organisation_number mod11_check = nil while mod11_check . nil? base = [ sample ( [ 8 , 9 ] ) , ( '%07d' % rand ( 10 ** 7 ) ) ] . join mod11_check = mod11 ( base ) end base + mod11_check . to_s end
Get a random Norwegian organization number.
Get a random Norwegian organization number .
# Valid leading digit: 8, 9