digestif
digestif copied to clipboard
API usage and confusion
Hey,
I'm not entirely sure I understand the API design. We have two types, ctx
and t
-- but what is the fundamental difference?
A ctx
we can create by either empty
or init
-- hold on, should the ctx
returned by empty
be immutable or better not being used?
A t
we receive from get
, but also from the functions that take care of computing the hash of a string / string list /...
Now, the nicely introduced get_into_bytes
is defined on ctx
, so if I computed the hash with digest_string
, I can't extract it into an existing byte vector.
Would it be possible to simplify the API and only provide a single type t? Since it is private anyways, I'd expect no issues... What do you think?