lib/pages/cheat.cheatmd

# Cheat Sheet

A quick reference for the most commonly used random data generator functions.

## [App](`NeoFaker.App`)

{: .col-2}

### [`author(opts \\ [])`](`NeoFaker.App.author/1`)

```elixir
iex> NeoFaker.App.author()
"José Valim"
```

### [`description(opts \\ [])`](`NeoFaker.App.description/1`)

```elixir
iex> NeoFaker.App.description()
"Elixir library for generating fake data in tests and development."
```

### [`license()`](`NeoFaker.App.license/0`)

```elixir
iex> NeoFaker.App.license()
"MIT License"
```

### [`name(opts \\ [])`](`NeoFaker.App.name/1`)

```elixir
iex> NeoFaker.App.name()
"Neo Faker"

iex> NeoFaker.App.name(style: :camel_case)
"neoFaker"
```

### [`semver(opts \\ [])`](`NeoFaker.App.semver/1`)

```elixir
iex> NeoFaker.App.semver()
"1.2.3"

iex> NeoFaker.App.semver(type: :pre_release)
"1.2.3-beta.1"
```

### [`version()`](`NeoFaker.App.version/0`)

```elixir
iex> NeoFaker.App.version()
"1.2"
```

## [Blood](`NeoFaker.Blood`)

{: .col-2}

### [`group()`](`NeoFaker.Blood.group/0`)

```elixir
iex> NeoFaker.Blood.group()
"B+"
```

### [`type()`](`NeoFaker.Blood.type/0`)

```elixir
iex> NeoFaker.Blood.type()
"B"
```

## [Boolean](`NeoFaker.Boolean`)

{: .col-1}

### [`boolean(true_ratio \\ 50, opts \\ [])`](`NeoFaker.Boolean.boolean/2`)

```elixir
iex> NeoFaker.Boolean.boolean()
false

iex> NeoFaker.Boolean.boolean(75)
true

iex> NeoFaker.Boolean.boolean(75, integer: true)
1
```

## [Color](`NeoFaker.Color`)

{: .col-2}

### [`cmyk(opts \\ [])`](`NeoFaker.Color.cmyk/1`)

```elixir
iex> NeoFaker.Color.cmyk()
{0, 25, 50, 100}

iex> NeoFaker.Color.cmyk(format: :w3c)
"cmyk(0%, 25%, 50%, 100%)"
```

`NeoFaker.Color.hsl/1`, `NeoFaker.Color.hsla/1`, `NeoFaker.Color.rgb/1` and
`NeoFaker.Color.rgba/1` behave the same way as `NeoFaker.Color.cmyk/1`.

### [`hex(opts \\ [])`](`NeoFaker.Color.hex/1`)

```elixir
iex> NeoFaker.Color.hex()
"#613583"

iex> NeoFaker.Color.hex(format: :three_digit)
"#365"
```

### [`keyword(opts \\ [])`](`NeoFaker.Color.keyword/1`)

```elixir
iex> NeoFaker.Color.keyword()
"blueviolet"

iex> NeoFaker.Color.keyword(category: :basic)
"purple"
```

## [Crypto](`NeoFaker.Crypto`)

{: .col-1}

### [`md5(opts \\ [])`](`NeoFaker.Crypto.md5/1`)

```elixir
iex> NeoFaker.Crypto.md5()
"e35cb102765cfc56df21ba4c16e6a636"

iex> NeoFaker.Crypto.md5(case: :upper)
"E35CB102765CFC56DF21BA4C16E6A636"
```

`NeoFaker.Crypto.sha1/1` and `NeoFaker.Crypto.sha256/1` behave the same way as
`NeoFaker.Crypto.md5/1`.

## [Gravatar](`NeoFaker.Gravatar`)

{: .col-1}

### [`display(email \\ nil, opts \\ [])`](`NeoFaker.Gravatar.display/2`)

```elixir
iex> NeoFaker.Gravatar.display()
"https://gravatar.com/avatar/<hashed_email>?d=identicon&s=80"

iex> NeoFaker.Gravatar.display("john.doe@example.com", fallback: :monsterid)
"https://gravatar.com/avatar/<hashed_email>?d=monsterid&s=80"
```

## [Lorem](`NeoFaker.Lorem`)

{: .col-1}

### [`sentence(opts \\ [])`](`NeoFaker.Lorem.sentence/1`)

```elixir
iex> NeoFaker.Lorem.paragraph()
"Suspendisse ac justo venenatis, tincidunt sapien nec, accumsan augue. Vestibulum urna
risus, egestas ut ultrices non, aliquet eget massa. Mauris id diam eget augue sagittis
convallis sit amet nec diam. Morbi ut blandit est, et placerat neque."

iex> NeoFaker.Lorem.paragraph(type: "meditations")
"Do the things external which fall upon thee distract thee? Give thyself time to learn
something new and good, and cease to be whirled around. But then thou must also avoid being
carried about the other way. For those too are triflers who have wearied themselves in life
by their activity, and yet have no object to which to direct every movement, and, in a word,
all their thoughts."
```

`NeoFaker.Lorem.sentence/1` and `NeoFaker.Lorem.word/1` behave the same way as
`NeoFaker.Lorem.paragraph/1`.

## [Number](`NeoFaker.Number`)

{: .col-2}

### [`between(min \\ 0, max \\ 100)`](`NeoFaker.Number.between/2`)

```elixir
iex> NeoFaker.Number.between()
27

iex> NeoFaker.Number.between(1, 100)
28

iex> NeoFaker.Number.between(1.0, 100.0)
29.481745280074264
```

### [`digit()`](`NeoFaker.Number.digit/0`)

```elixir
iex> NeoFaker.Number.digit()
5
```

### [`float(left_digit \\ 10..100, right_digit \\ 10000..100_000)`](`NeoFaker.Number.float/2`)

```elixir
iex> NeoFaker.Number.float()
30.94372

iex> NeoFaker.Number.float(1..9, 10..90)
1.44
```

## [Person](`NeoFaker.Person`)

{: .col-2}

### [`age(min \\ 0, max \\ 120)`](`NeoFaker.Person.age/2`)

```elixir
iex> NeoFaker.Person.age()
44

iex> NeoFaker.Person.age(7, 44)
27
```

### [`binary_gender()`](`NeoFaker.Person.binary_gender/0`)

```elixir
iex> NeoFaker.Person.binary_gender()
"Male"
```

### [`first_name(opts \\ [])`](`NeoFaker.Person.first_name/1`)

```elixir
iex> NeoFaker.Person.first_name()
"Julia"

iex> NeoFaker.Person.first_name(type: :male)
"José"
```

`NeoFaker.Person.middle_name/1` and `NeoFaker.Person.last_name/1` behave the same way as
`NeoFaker.Person.first_name/1`.

### [`full_name(opts \\ [])`](`NeoFaker.Person.full_name/1`)

```elixir
iex> NeoFaker.Person.full_name()
"Abigail Bethany Crawford"

iex> NeoFaker.Person.full_name(sex: :male)
"Daniel Edward Fisher"

iex> NeoFaker.Person.full_name(middle_name: false)
"Gabriella Harrison"
```

### [`non_binary_gender(opts \\ [])`](`NeoFaker.Person.non_binary_gender/1`)

```elixir
iex> NeoFaker.Person.non_binary_gender()
"Agender"
```

### [`prefix(opts \\ [])`](`NeoFaker.Person.prefix/1`)

```elixir
iex> NeoFaker.Person.prefix()
"Mr."
```

### [`short_binary_gender(opts \\ [])`](`NeoFaker.Person.short_binary_gender/1`)

```elixir
iex> NeoFaker.Person.short_binary_gender()
"F"
```

### [`suffix(opts \\ [])`](`NeoFaker.Person.suffix/1`)

```elixir
iex> NeoFaker.Person.suffix()
"IV"
```

## [Text](`NeoFaker.Text`)

{: .col-2}

### [`character(opts \\ [])`](`NeoFaker.Text.character/1`)

```elixir
iex> NeoFaker.Text.character()
"a"

iex> NeoFaker.Text.character(type: :digit)
"0"
```

### [`characters(number \\ 11, opts \\ [])`](`NeoFaker.Text.characters/2`)

```elixir
iex> NeoFaker.Text.characters()
"XfELJU1mRMg"

iex> NeoFaker.Text.characters(20, type: :alphabet_upper)
"BVAJHRGSCEVJFNYSWCJE"
```

### [`emoji(opts \\ [])`](`NeoFaker.Text.emoji/1`)

```elixir
iex> NeoFaker.Text.emoji()
"✨"

iex> NeoFaker.Text.emoji(category: :activities)
"🎉"
```