buddy.core.codecs

Util functions for make conversion between string, bytes and encode them to base64 ot hex format.

->bytes

added in 1.11

(->bytes data)

A convenience alias for to-bytes

b64->bytes

added in 1.8.0

(b64->bytes data)(b64->bytes data urlsafe?)

Decode base64 bytes array

b64->str

added in 1.11

(b64->str data)(b64->str data urlsafe?)

Decode base64 byte array to string.

b64u->bytes

added in 1.8

deprecated in 1.11

(b64u->bytes data)

Decode base64 bytes array (using url-safe variant)

NOTE: DEPRECATED

bytes->b64

added in 1.8.0

(bytes->b64 data)(bytes->b64 data urlsafe?)

Encode bytes to base64 byte array (using standard variant).

bytes->b64-str

added in 1.11

(bytes->b64-str data)(bytes->b64-str data urlsafe?)

Encode data to base64 string (using standard variant).

bytes->b64u

added in 1.8

deprecated in 1.11

(bytes->b64u data)

Encode data to base64 byte array (using url-safe variant)

NOTE: DEPRECATED

bytes->hex

(bytes->hex data)

Convert a byte array to hex encoded string.

bytes->long

(bytes->long input)

bytes->str

(bytes->str data)(bytes->str data encoding)

Convert byte array to String.

hex->bytes

(hex->bytes data)

Convert hexadecimal encoded string to bytes array.

IByteArray

protocol

Facility for convert input parameters to bytes array with default implementation for string an bytes array itself.

members

-to-bytes

(-to-bytes this)

Represent this as byte array.

long->bytes

(long->bytes input)

str->bytes

(str->bytes s)(str->bytes s encoding)

Convert string to byte array.

to-bytes

(to-bytes v)

Encode as byte array