View Source Avatarex (Avatarex v0.1.1)

Avatarex is inspired by Robohash: https://github.com/e1ven/Robohash

Two Avatar sets are provided Avatarex.Birdy and Avatarex.Kitty

Link to this section Summary

Functions

Generates a random birdy avatar

Generates an AvatarexKitty avatar constructed using the hash of the given name.

Generates an avatar for a given name and Avatar type. Defaults to :kitty

Generates a hash for a given string using sha512 from Erlang's crypto module.

Generates a random kitty avatar

Generates an AvatarexKitty avatar constructed using the hash of the given name.

Link to this section Functions

Generates a random birdy avatar

examples

Examples

iex> Avatarex.birdy()
%Avatarex.Birdy{}
Link to this function

birdy(string)

View Source (since 0.1.0)

Generates an AvatarexKitty avatar constructed using the hash of the given name.

examples

Examples

iex> Avatarex.birdy(name)
%Avatarex.Birdy{name: name, ...}
Link to this function

generate(name, set \\ :kitty)

View Source (since 0.1.0)

Generates an avatar for a given name and Avatar type. Defaults to :kitty

examples

Examples

iex> Avatarex.generate("oscar", :birdy)
%Avatarex.Birdy{name: oscar}
Link to this function

hash(avatar_string)

View Source (since 0.1.0)

Generates a hash for a given string using sha512 from Erlang's crypto module.

examples

Examples

iex> Avatarex.hash("avatar_name")
<<130, 249, 176, 138, 182, 111, 225, 152, 83, 237, ... >>

Generates a random kitty avatar

examples

Examples

iex> Avatarex.kitty()
%Avatarex.Kitty{}
Link to this function

kitty(string)

View Source (since 0.1.0)

Generates an AvatarexKitty avatar constructed using the hash of the given name.

examples

Examples

iex> Avatarex.kitty(name)
%Avatarex.Kitty{name: name, ...}