z85Decode

Decodes a binary key from Z85 printable _text.

dest must be an array whose length is at least 4*data.length/5, which will be used to store the return value. If dest is omitted, a new array will be created.

Note that $(ZMQREF zmq_z85_decode()) expects a zero-terminated string, so a zero byte will be appended to text if it does not contain one already. However, this may trigger a (possibly unwanted) GC allocation. To avoid this, either make sure that the last character in text is '\0', or use $(OBJREF assumeSafeAppend) on the array before calling this function (provided this is safe).

  1. ubyte[] z85Decode(char[] text, ubyte[] dest)
    @safe
    ubyte[]
    z85Decode
    (
    char[] text
    ,
    ubyte[] dest
    )
  2. ubyte[] z85Decode(char[] text)

Return Value

Type: ubyte[]

An array of size 4*data.length/5 which contains the decoded data. This will be a slice of dest if it is provided.

Throws

$(COREF exception,RangeError) if dest is given but is too small.
ZmqException if $(ZMQ) reports an error (i.e., if data.length is not a multiple of 5).

Corresponds to

$(ZMQREF zmq_z85_decode())

Meta