-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bytes/hash: rename to hash/maphash #34778
Comments
We sort of settled on a byte stream API, so bytes/hash seemed reasonable. Maybe The hashes in |
The fact that it's not spec'ed and can't escape the current program seems like the most important property, not the "stream" part. All hashes are streams. Maybe hash.Local or hash.Private or hash.Unspecified or hash.InMemory or hash.Undefined or ... |
(Just bikeshedding, feel free to ignore.)
|
Not Runtime -- we don't guarantee it's the same one used by Go maps. If Fast is a bad name because it draws users to it like magpies to a shiny thing, then Unspecified is a good name. |
|
unspecified is such a long name to type. hash/unspec better ideas? |
or hash/maphash? // Package maphash implements a fast, randomly seeded, collision-resistant hash function |
Short: hash.Mem, hash.Go (or hash/memhash, hash/gohash) |
It looks like there is a strong consensus for hash/maphash. Let's go with that. |
Change https://golang.org/cl/204997 mentions this issue: |
The implementation landed for #28322, which is great (thanks!).
The choice of
bytes/hash
as the import path is probably not right.Based on the discussion on #28322, it's not completely clear it will
stay limited to bytes for all time. Even if it did, it is unclear why it is
bytes/hash and not hash/bytes. Neither is great, since the package
name alone shadows either bytes or hash. As it is, the current
bytes/hash.Hash implements (non-bytes/)hash.Hash, which is
pretty confusing. Goimports won't know what to do for hash.Hash
anymore, and so on.
It seems like it should be either in package hash, with a clear name
(hash.Seeded? hash.Random?),
or else in a hash/something package with a clear name.
/cc @randall77 @bradfitz @alandonovan
The text was updated successfully, but these errors were encountered: