Short v0.0.3 Short.Code View Source
A Short Code.
This module defined a Short Code and the main functions for working with Short Codes.
Link to this section Summary
Functions
Generates valid code
Returns a new Wrapped code
Check if the code is valid to be used in an URI
Link to this section Types
Link to this section Functions
Generates valid code.
By default, the code will be of default_code_length
length. Short allows
this default code length to be overriden through the Mix configuration of the
:short
application. For example, to override the length, the following
config can be specified:
config :short, :code_length, 7
Returns a new Wrapped code.
Examples
iex> Short.Code.new("abc")
%Short.Code{__code: "abc"}
iex> Short.Code.new("?!&")
%Short.Code{__code: "?!&"}