buddy.core.bytes

A collection of functions for work with byte arrays and bytes.

bytes?

(bytes? x)

Test if a first parameter is a byte array or not.

concat

(concat & parts)

Given N number of byte arrays, concat them in one unique byte array and return it.

copy

(copy input)

Is a specialized version of slice that just copy the byte array.

equals?

(equals? a b)

Test whether two sequences of characters or bytes are equal in a way that protects against timing attacks. Note that this does not prevent an attacker from discovering the length of the data being compared.

fill!

(fill! input val)(fill! input val & {:keys [limit offset start end]})

Assigns the specified byte value to each element of the specified array of bytes.

slice

(slice input start end)

Returns a new copy of the byte array but offset and crop by start and end indices.