View Source Faker.Internet (Faker v0.18.0)

Functions for generating internet related data

Summary

Functions

Returns a complete random domain name

Returns a random domain suffix

Returns a random domain word

Returns a complete email based on a domain name

Returns a complete free email based on a free email service [gmail, yahoo, hotmail]

Returns a free email service

Returns a random image url from placekitten.com | placehold.it | dummyimage.com

Generates an ipv4 address

Generates an ipv6 address

Generates a mac address

Returns a safe email

Generates a slug If no words are provided it will generate 2 to 5 random words If no glue is provided it will use one of -, _ or .

Returns a random url

Returns a random username

Functions

@spec domain_name() :: String.t()

Returns a complete random domain name

Examples

iex> Faker.Internet.domain_name()
"blick.org"
iex> Faker.Internet.domain_name()
"schumm.info"
iex> Faker.Internet.domain_name()
"sipes.com"
iex> Faker.Internet.domain_name()
"hane.info"
@spec domain_suffix() :: String.t()

Returns a random domain suffix

Examples

iex> Faker.Internet.domain_suffix()
"com"
iex> Faker.Internet.domain_suffix()
"org"
iex> Faker.Internet.domain_suffix()
"name"
iex> Faker.Internet.domain_suffix()
"info"
@spec domain_word() :: String.t()

Returns a random domain word

Examples

iex> Faker.Internet.domain_word()
"blick"
iex> Faker.Internet.domain_word()
"hayes"
iex> Faker.Internet.domain_word()
"schumm"
iex> Faker.Internet.domain_word()
"rolfson"
@spec email() :: String.t()

Returns a complete email based on a domain name

Examples

iex> Faker.Internet.email()
"elizabeth2056@rolfson.net"
iex> Faker.Internet.email()
"conor2058@schiller.com"
iex> Faker.Internet.email()
"frederique2063@metz.name"
iex> Faker.Internet.email()
"jana2042@price.biz"
@spec free_email() :: String.t()

Returns a complete free email based on a free email service [gmail, yahoo, hotmail]

Examples

iex> Faker.Internet.free_email()
"elizabeth2056@hotmail.com"
iex> Faker.Internet.free_email()
"trycia1982@hotmail.com"
iex> Faker.Internet.free_email()
"delphine_hartmann@yahoo.com"
iex> Faker.Internet.free_email()
"mitchel_rutherford@yahoo.com"
@spec free_email_service() :: String.t()

Returns a free email service

Examples

iex> Faker.Internet.free_email_service()
"gmail.com"
iex> Faker.Internet.free_email_service()
"hotmail.com"
iex> Faker.Internet.free_email_service()
"gmail.com"
iex> Faker.Internet.free_email_service()
"hotmail.com"
@spec image_url() :: String.t()

Returns a random image url from placekitten.com | placehold.it | dummyimage.com

Examples

iex> Faker.Internet.image_url()
"https://placekitten.com/131/131"
iex> Faker.Internet.image_url()
"https://placekitten.com/554/554"
iex> Faker.Internet.image_url()
"https://picsum.photos/936"
iex> Faker.Internet.image_url()
"https://picsum.photos/541"
@spec ip_v4_address() :: String.t()

Generates an ipv4 address

Examples

iex> Faker.Internet.ip_v4_address()
"214.217.139.136"
iex> Faker.Internet.ip_v4_address()
"200.102.244.150"
iex> Faker.Internet.ip_v4_address()
"219.212.222.123"
iex> Faker.Internet.ip_v4_address()
"164.141.15.82"
@spec ip_v6_address() :: String.t()

Generates an ipv6 address

Examples

iex> Faker.Internet.ip_v6_address()
"A2D6:F5D9:BD8B:C588:0DC8:9566:43F4:B196"
iex> Faker.Internet.ip_v6_address()
"05DB:FAD4:88DE:397B:75A4:A98D:DF0F:1F52"
iex> Faker.Internet.ip_v6_address()
"6229:4EFA:2F7B:FEF9:EB07:0128:85B2:DC72"
iex> Faker.Internet.ip_v6_address()
"E867:34BC:715B:FB7C:7E96:AF4F:C733:A82D"
@spec mac_address() :: String.t()

Generates a mac address

Examples

iex> Faker.Internet.mac_address()
"d6:d9:8b:88:c8:66"
iex> Faker.Internet.mac_address()
"f4:96:db:d4:de:7b"
iex> Faker.Internet.mac_address()
"a4:8d:0f:52:29:fa"
iex> Faker.Internet.mac_address()
"7b:f9:07:28:b2:72"
@spec safe_email() :: String.t()

Returns a safe email

Examples

iex> Faker.Internet.safe_email()
"elizabeth2056@example.net"
iex> Faker.Internet.safe_email()
"trycia1982@example.net"
iex> Faker.Internet.safe_email()
"delphine_hartmann@example.com"
iex> Faker.Internet.safe_email()
"mitchel_rutherford@example.com"
@spec slug() :: String.t()

Generates a slug If no words are provided it will generate 2 to 5 random words If no glue is provided it will use one of -, _ or .

Examples

iex> Faker.Internet.slug()
"sint-deleniti-consequatur-ut"
iex> Faker.Internet.slug()
"sit_et"
iex> Faker.Internet.slug(["foo", "bar"])
"foo-bar"
iex> Faker.Internet.slug(["foo", "bar"], ["."])
"foo.bar"
@spec slug([String.t()]) :: String.t()
@spec slug([String.t()], [String.t()]) :: String.t()
@spec url() :: String.t()

Returns a random url

Examples

iex> Faker.Internet.url()
"http://hayes.name"
iex> Faker.Internet.url()
"http://sipes.com"
iex> Faker.Internet.url()
"http://padberg.name"
iex> Faker.Internet.url()
"http://hartmann.biz"
@spec user_name() :: String.t()

Returns a random username

Examples

iex> Faker.Internet.user_name()
"elizabeth2056"
iex> Faker.Internet.user_name()
"reese1921"
iex> Faker.Internet.user_name()
"aniya1972"
iex> Faker.Internet.user_name()
"bianka2054"