Curvy.Util (Curvy v0.3.1) View Source

Utility module for common and shared functions.

Link to this section Summary

Functions

Decodes the given binary with the specified encoding scheme.

Encodes the given binary with the specified encoding scheme.

Invert operation.

Inverse power operation.

Modulo operation. Returns the remainder after x is divided by n.

Link to this section Functions

Specs

decode(binary(), atom()) :: {:ok, binary()} | {:error, any()}

Decodes the given binary with the specified encoding scheme.

Accepts :base64 or :hex, or will return the binary as is.

Specs

encode(binary(), atom()) :: binary()

Encodes the given binary with the specified encoding scheme.

Accepts :base64 or :hex, or will return the binary as is.

Specs

inv(integer(), integer()) :: integer()

Invert operation.

Inverse power operation.

Specs

mod(integer(), integer()) :: integer()

Modulo operation. Returns the remainder after x is divided by n.