module
RemiLib::Z85
Overview
The Z85 module contains an implementation of z85 binary <=> text conversions.
This is based on the reference implementation: https://rfc.zeromq.org/spec/32/
Defined in:
remilib/z85.crClass Method Summary
-
.decode(source : IO, dest : IO, padByte : UInt8 = 0) : Nil
Decodes z85 encoded data from source and writes the results to dest.
-
.decode(str : String) : Array(UInt8)
Decodes a z85-encoded string to a new array of bytes.
-
.decodeTo(str : String, dest : IO) : Nil
Decodes a z85-encoded string to an
IO. -
.decodeToBytes(str : String) : Bytes
Decodes a z85-encoded string to a
Bytes. -
.decodeToStr(str : String) : String
Decodes a z85-encoded string to a new string.
-
.encode(value : Bytes, dest : IO) : Nil
Encodes value using z85 encoding and writes the results to io.
-
.encode(value : Array(UInt8), dest : IO) : Nil
Encodes value using z85 encoding and writes the results to io.
- .encode(value : String, dest : IO) : Nil
-
.encode(source : IO, dest : IO, padByte : UInt8 = 0) : Nil
Encodes data from source using z85 encoding and writes the results to dest.
-
.encode(value : Bytes) : String
Encodes value using z85 encoding and returns a new string with the encoded data.
-
.encode(value : Array(UInt8)) : String
Encodes value using z85 encoding and returns a new string with the encoded data.
-
.encode(value : String) : String
Encodes value using z85 encoding and returns a new string with the encoded data.
Class Method Detail
Decodes z85 encoded data from source and writes the results to dest. If the number of bytes read from source is not a multiple of five, this will only write as much data as it could encode.
Decodes a z85-encoded string to a new array of bytes. The length of str must be a multiple of five.
Decodes a z85-encoded string to an IO. The length of str must be a
multiple of five.
Decodes a z85-encoded string to a Bytes. The length of str must be a
multiple of five.
Decodes a z85-encoded string to a new string. The length of str must be a multiple of five.
Encodes value using z85 encoding and writes the results to io. The length of value must be a multiple of four.
Encodes value using z85 encoding and writes the results to io. The length of value must be a multiple of four.
Encodes value using z85 encoding and writes the results to io. The
String#bytesize of value must be a multiple of four.
Encodes data from source using z85 encoding and writes the results to dest. If the number of bytes read from source is not a multiple of four, then padByte will be added and encoded until the required length is met.
Encodes value using z85 encoding and returns a new string with the encoded data. The length of value must be a multiple of four.
Encodes value using z85 encoding and returns a new string with the encoded data. The length of value must be a multiple of four.
Encodes value using z85 encoding and returns a new string with the encoded
data. The String#bytesize of value must be a multiple of four.