xdr v0.1.1 XDR.Type.Uint View Source

RFC 4506, Section 4.2 - Unsigned Integer

Link to this section Summary

Types

t()

Integer between 0 and 2^32 - 1

Functions

Decodes a 4-byte binary into an unsigned integer

Encodes an unsigned integer into a 4-byte binary

Determines if a value is a valid 4-byte unsigned integer

Link to this section Types

Link to this type t() View Source
t() :: 0..4294967295

Integer between 0 and 2^32 - 1

Link to this section Functions

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

Decodes a 4-byte binary into an unsigned integer

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

Encodes an unsigned integer into a 4-byte binary

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

Determines if a value is a valid 4-byte unsigned integer