xdr v0.1.2 XDR.Type.HyperInt View Source

RFC 4506, Section 4.5 - Hyper Integer

Link to this section Summary

Types

t()

Hyper integer between -2^63 to 2^63 - 1

Functions

Decodes an 8-byte binary into a hyper integer

Encodes a hyper integer into an 8-byte binary

Determines if a value is a valid 8-byte hyper integer

Link to this section Types

Link to this type t() View Source
t() :: -9223372036854775808..9223372036854775807

Hyper integer between -2^63 to 2^63 - 1

Link to this type xdr() View Source
xdr() :: <<_::_*64>>

Link to this section Functions

Link to this function decode(xdr) View Source
decode(xdr :: xdr()) ::
  {:ok, {hyper_int :: t(), rest :: XDR.Type.Base.xdr()}} |
  {:error, :invalid}

Decodes an 8-byte binary into a hyper integer

Link to this function encode(hyper_int) View Source
encode(hyper_int :: t()) ::
  {:ok, xdr :: xdr()} |
  {:error, :invalid | :out_of_bounds}

Encodes a hyper integer into an 8-byte binary

Link to this function valid?(hyper_int) View Source
valid?(hyper_int :: t()) :: boolean()

Determines if a value is a valid 8-byte hyper integer