Uptight.Base (Uptight v0.2.2-rc)

Type wrappers for BaseN representations of binary data.

Link to this section Summary

Link to this section Types

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()

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>>}}

Specs

mk32(binary()) :: Uptight.Result.t()

Specs

mk64(binary()) :: Uptight.Result.t()

Specs

mk_url(binary()) :: Uptight.Result.t()

Specs

mk_url!(binary()) :: Uptight.Base.Urlsafe.t()

Specs

new() :: t()

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

Specs

new!(binary()) :: t()
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()

Specs

See Uptight.Base.binary_to_urlsafe/1.

Specs

See Uptight.Base.binary_to_urlsafe!/1.