xdr v0.1.1 XDR.Type.String View Source

RFC 4506, Section 4.11 - String

Link to this section Summary

Types

t()

A bitstrng of max-length 2^32 - 1

Functions

Decodes a valid string xdr binary, removing the 4-byte length and any provided padding

Encodes a valid string by prepending the 4-byte length and appending any necessary padding

Determines if a value is a bitstring of a valid length

Link to this section Types

Link to this section Functions

Link to this function decode(xdr, max_len \\ 4294967295) View Source
decode(xdr :: xdr(), max_len :: max()) ::
  {:ok, {string :: t(), rest :: XDR.Type.Base.xdr()}} |
  decode_error()

Decodes a valid string xdr binary, removing the 4-byte length and any provided padding

Link to this function encode(string, max_len \\ 4294967295) View Source
encode(string :: t(), max_len :: max()) ::
  {:ok, xdr :: xdr()} |
  {:error, :invalid}

Encodes a valid string by prepending the 4-byte length and appending any necessary padding

Link to this function valid?(string, max_len \\ 4294967295) View Source
valid?(string :: t(), max_len :: max()) :: boolean()

Determines if a value is a bitstring of a valid length