std.lib.encode

+hex-array+

from-base64

added in 3.0

(from-base64 input)

turns a base64 encoded string into a byte array

(-> (from-base64 “aGVsbG8=”) (String.)) => “hello”

from-hex

added in 3.0

(from-hex s)

turns a hex string into a sequence of bytes

(String. (from-hex “68656c6c6f”)) => “hello”

from-hex-chars

added in 3.0

(from-hex-chars c1 c2)

turns two hex characters into a byte value

(byte (from-hex-chars  \a)) => 42

hex-chars

added in 3.0

(hex-chars b)

turns a byte into two chars

(hex-chars 255) => \f \f

(hex-chars 42) =>  \a

to-base64

added in 3.0

(to-base64 bytes)

turns a byte array into a base64 encoded string

(-> (.getBytes “hello”) (to-base64)) => “aGVsbG8=”

to-base64-bytes

added in 3.0

(to-base64-bytes bytes)

turns a byte array into a base64 encoding

(-> (.getBytes “hello”) (to-base64-bytes) (String.)) => “aGVsbG8=”

to-hex

added in 3.0

(to-hex bytes)

turns a byte array into hex string

(to-hex (.getBytes “hello”)) => “68656c6c6f”

to-hex-chars

added in 3.0

(to-hex-chars bytes)

turns a byte array into a hex char array