cespare / xxhash

A Go implementation of the 64-bit xxHash algorithm (XXH64)
MIT License
1.79k stars 123 forks source link

Option for seed value? #35

Closed benjamin-bader closed 4 years ago

benjamin-bader commented 4 years ago

Hi there,

I notice that in the canonical C implementation, as well as in most libraries that wrap it, x32 and x64 digests accept a "seed" value. Have you given any thought to including one in your Digest API?

I personally would find it nice; my use case here is ensuring consistent digests across platforms and languages, and while I can do so today, it's at the expense of making every other platform a little more complicated (by adding a manual few "seed" bytes to the start of each digest, for example).

TL;DR: In most xxhash libs I've seen so far, I can do something like d.Reset(seed). It'd be nice if this library allowed that option, too. Would you be open to this kind of change?

benjamin-bader commented 4 years ago

On further thought, this seems like a poor fit for the current API as implemented.

cespare commented 6 months ago

I decided to add API for this in #77.