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
Constructors of SipHash (New64() and New128()) are inconsistent with ad hoc routines (Sum64() and Sum128()). Parameter key is specified as either fixed size array or slice. It would be greate use slice in all cases. Moreover, I think that key representation as byte slice is not very convenient. Perhaps two uint64 numbers would be better.
The reason for using an array type for Sum64() / Sum128 is that these functions should not return an error in case of invalid key length. However, I agree that it looks a bit odd from a user perspective.
It would be greate use slice in all cases.
That would force either panic'ing in case of invalid key length or returning an error for all functions.
Neither approach is ideal IMO. Actually a New64(key *[16]byte) hash.Hash { ... } would enforce a well-formed key through the type-system.
Moreover, I think that key representation as byte slice is not very convenient.
Can you explain why this should be inconvenient. Keys are usually passed as bit/byte string. For example: how would k0, k1 correspond to a byte string? - little/big endian, is the MSB in k0 or in k1, ...?!
Constructors of SipHash (
New64()
andNew128()
) are inconsistent with ad hoc routines (Sum64()
andSum128()
). Parameterkey
is specified as either fixed size array or slice. It would be greate use slice in all cases. Moreover, I think that key representation as byte slice is not very convenient. Perhaps twouint64
numbers would be better.The text was updated successfully, but these errors were encountered: