meow_hash icon indicating copy to clipboard operation
meow_hash copied to clipboard

Make input parameters const?

Open glampert opened this issue 3 years ago • 0 comments

Input pointer parameters in the function signatures are not const, e.g.:

static meow_u128 MeowHash(void *Seed128Init, meow_umm Len, void *SourceInit)

This gives the impression to readers on a glance that the functions are actually modifying the data they are hashing, which I'm fairly sure is not the case!

It also has the inconvenience that to hash an object that is already const qualified you have to add an explicit cast, e.g.:

uint64_t HashBlob(const Blob* pBlob)
{
    result = MeowHash(MySeed, sizeof(Blob), (void*)pBlob);
    ...
}

Could we please have the function signatures updated to take all input parameters by const pointer? Thanks!

glampert avatar Jun 17 '21 21:06 glampert