diff options
author | alandonovan <adonovan@google.com> | 2019-05-14 14:50:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-14 14:50:48 -0400 |
commit | e35f71a0bd6668ef140b005aa9b2a9010b827c44 (patch) | |
tree | 44bd43bd8c2d037a267ba7a67e9498dc6889dfde /internal | |
parent | 9316ba3d7775a7ea1981c9edc7cf361ea02d3c82 (diff) | |
download | starlark-go-e35f71a0bd6668ef140b005aa9b2a9010b827c44.tar.gz |
hash: allow only strings, and use same algorithm as Starlark-in-Java (#198)
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.
Now we reproduce the algorithm used by Starkar-in-Java,
which is that defined (and guaranteed) by java.lang.String.hashCode,
a polynomial accumulator over the UTF-16 transcoding of the string.
+ Test
Diffstat (limited to 'internal')
0 files changed, 0 insertions, 0 deletions