Provide basic functionality for byte string manipulations
In its current form, Clotho requires users to use get-current-random-source-byte-string
to extract a bytes?
object and then manually manipulate that object. This manipulation requires knowledge of Clotho's inner workings. Since manipulation of the random source is a fundamental principle of Clotho's design, it seems reasonable to at least provide some functions that would make this more straightforward.
For example, a function (modify-byte-string byte-string at-index)
could be used to automatically adjust the 4-byte sequence at the at-index
position within byte-string
, perhaps by converting it to an integer and incrementing by 1 (wrapping to 0 as needed).
Alternatively, the functions could operate on random sources instead of byte strings directly, e.g., (modify-nth-generation (current-random-source) 4)
would modify the 4th random value generation (i.e., the 16th-19th bytes) of the byte string contained in the current-random-source
, returning a new random-source?
that could be used in a parameterize
call.