Uptight.Base (Uptight v0.2.7-rc)
Type wrappers for BaseN representations of binary data.
Link to this section Summary
Link to this section Types
Specs
t() :: Uptight.Base.Urlsafe.t() | Uptight.Base.SixtyFour.t() | Uptight.Base.ThirtyTwo.t() | Uptight.Base.Sixteen.t()
Link to this section Functions
Link to this function
binary_to_urlsafe(x)
Specs
binary_to_urlsafe(Uptight.Binary.t()) :: Uptight.Result.t()
Link to this function
binary_to_urlsafe!(x)
Specs
binary_to_urlsafe!(Uptight.Binary.t()) :: Uptight.Base.Urlsafe.t()
Link to this function
mk16(x)
Specs
mk16(binary()) :: Uptight.Result.t()
Perhaps, constructs a representation of a hex string.
Example
iex> Uptight.Base.mk16("1337C0DE")
%Uptight.Result.Ok{ok: %Uptight.Base.Sixteen{encoded: "1337C0DE", raw: <<19, 55, 192, 222>>}}
Link to this function
mk32(x)
Specs
mk32(binary()) :: Uptight.Result.t()
Link to this function
mk64(x)
Specs
mk64(binary()) :: Uptight.Result.t()
Link to this function
mk_url(x)
Specs
mk_url(binary()) :: Uptight.Result.t()
Link to this function
mk_url!(x)
Specs
mk_url!(binary()) :: Uptight.Base.Urlsafe.t()
Link to this function
new()
Specs
new() :: t()
Link to this function
new(x)
Specs
new(binary()) :: Uptight.Result.t()
Defensive constructor.
Examples
iex> Uptight.Base.new("0L/Ri9GJIG9sb2xvINGPINCy0L7QtNC40YLQtdC70Ywg0J3Qm9CeIQ==")
%Uptight.Result.Ok{
ok: %Uptight.Base.SixtyFour{
encoded: "0L/Ri9GJIG9sb2xvINGPINCy0L7QtNC40YLQtdC70Ywg0J3Qm9CeIQ==",
raw: "пыщ ololo я водитель НЛО!"
}
}
iex> Uptight.Base.new("0L/Ri9GJIG9sb2xvINGPINCy0L7QtNC40YLQtdC70Ywg0J3Qm9CeIQ==") |> Uptight.Result.is_ok?()
true
Link to this function
new!(arg)
Specs
Link to this function
raw_to_urlsafe(arg)
Specs
raw_to_urlsafe(binary()) :: Uptight.Result.t()
Link to this function
raw_to_urlsafe!(arg)
Specs
raw_to_urlsafe!(binary()) :: Uptight.Base.Urlsafe.t()
Link to this function
safe(binary)
Specs
safe(Uptight.Binary.t()) :: Uptight.Result.t()
Link to this function
safe!(binary)
Specs
safe!(Uptight.Binary.t()) :: Uptight.Base.Urlsafe.t()