You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a sharp edge of the API. It's tempting (especially if xxhash.Digest is embedded in a larger structure) to do this:
var d xxhash.Digest
... d.Write(...) ...
h := d.Sum64()
But this is broken: the zero value of Digest is not usable. You must call Reset first.
We should fix this, either by making the incorrect usage crash or by automatically calling Reset when an uninitialized Digest is used. Hopefully the branch is very predictable and doesn't add much cost.
The text was updated successfully, but these errors were encountered:
I noticed a sharp edge of the API. It's tempting (especially if
xxhash.Digest
is embedded in a larger structure) to do this:But this is broken: the zero value of
Digest
is not usable. You must callReset
first.We should fix this, either by making the incorrect usage crash or by automatically calling
Reset
when an uninitializedDigest
is used. Hopefully the branch is very predictable and doesn't add much cost.The text was updated successfully, but these errors were encountered: