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.cr

Class Method Summary

Class Method Detail

def self.decode(source : IO, dest : IO, padByte : UInt8 = 0) : Nil #

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.


[View source]
def self.decode(str : String) : Array(UInt8) #

Decodes a z85-encoded string to a new array of bytes. The length of str must be a multiple of five.


[View source]
def self.decodeTo(str : String, dest : IO) : Nil #

Decodes a z85-encoded string to an IO. The length of str must be a multiple of five.


[View source]
def self.decodeToBytes(str : String) : Bytes #

Decodes a z85-encoded string to a Bytes. The length of str must be a multiple of five.


[View source]
def self.decodeToStr(str : String) : String #

Decodes a z85-encoded string to a new string. The length of str must be a multiple of five.


[View source]
def self.encode(value : Bytes, dest : IO) : Nil #

Encodes value using z85 encoding and writes the results to io. The length of value must be a multiple of four.


[View source]
def self.encode(value : Array(UInt8), dest : IO) : Nil #

Encodes value using z85 encoding and writes the results to io. The length of value must be a multiple of four.


[View source]
def self.encode(value : String, dest : IO) : Nil #

Encodes value using z85 encoding and writes the results to io. The

String#bytesize of value must be a multiple of four.


[View source]
def self.encode(source : IO, dest : IO, padByte : UInt8 = 0) : Nil #

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.


[View source]
def self.encode(value : Bytes) : String #

Encodes value using z85 encoding and returns a new string with the encoded data. The length of value must be a multiple of four.


[View source]
def self.encode(value : Array(UInt8)) : String #

Encodes value using z85 encoding and returns a new string with the encoded data. The length of value must be a multiple of four.


[View source]
def self.encode(value : String) : String #

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.


[View source]