View Source Avatarex (Avatarex v0.1.0)
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{}
Generates an AvatarexKitty
avatar constructed
using the hash of the given name.
examples
Examples
iex> Avatarex.birdy(name)
%Avatarex.Birdy{name: name, ...}
Generates an avatar for a given name and Avatar type. Defaults to :kitty
examples
Examples
iex> Avatarex.generate("oscar", :birdy)
%Avatarex.Birdy{name: oscar}
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{}
Generates an AvatarexKitty
avatar constructed
using the hash of the given name.
examples
Examples
iex> Avatarex.kitty(name)
%Avatarex.Kitty{name: name, ...}