Closed alandonovan closed 5 years ago
@laurentlb -- this change brings the Go and Java impls closer, and fixes a bug in which the set of targets in a Bazel package would vary from one run to the next.
A question: should Starlark in Go attempt to generate the exact same hashes as Starlark-in-Java, which hashes the sequence of UTF-16 codes using a polynomial accumulator? Transcoding valid UTF-8 to 16 is not hard, but it does seem to be indulging bad habits of writing code that depends on hashing for its observed results. On the other hand, that is exactly what some users do.
Previously, hash would allow any operand defined as hashable by the spec, and would use (for strings at least) a fast hardware implementation that varies across process restarts.