Module

Data.ArrayBuffer.Z85.Internal

Package
purescript-z85
Repository
athanclark/purescript-z85

#Base85 Source

type Base85 = UInt

Represents a single base85 digit between 0 and 84

#Base256 Source

type Base256 = UInt

Represents a single base256 digit between 0x00 and 0xFF - a Byte

#Z85Char Source

newtype Z85Char

Character included in the z85 character set: 0-9, a-z, A-Z, and :+=^!/*?&<>()[]{}@%$#

Constructors

Instances

#getZ85Char Source

#Z85Chunk Source

type Z85Chunk = Vec D5 Z85Char

Represents a 32-bit word encoded as 5 z85 characters

#z85Chars Source

z85Chars :: String

Sorted by their value in the z85 encoding

#lookupZ85Char Source

#charCodeToBase85 Source

charCodeToBase85 :: Array Base85

Reverse-sorted by the lookup index obtained by getting the UTF-16 char code value, minus 32 - the equivalent of "n".charCodeAt(0) - 32 in JavaScript, where n is some x85 character.

#encodeWord Source

encodeWord :: UInt -> Z85Chunk

Encodes the value by extracting it out of a little-endian packed word, and packing it into five x85 chars