Closed GoogleCodeExporter closed 9 years ago
If you just call Hasher#hashString(String), it'll hash each character in order
(no char encoding).
What you want is Hasher#hashString(String, Charset).
HashCode foxHash = Hashing.murmur3_128(0).hashString(
"The quick brown fox jumps over the lazy dog", Charsets.UTF_8);
assertEquals("6c1b07bc7bbc4be347939ac4a93c437a", foxHash.toString());
Original comment by kurt.kluever
on 13 Sep 2012 at 4:49
Rather than "no char encoding", isn't it more accurate to say that the char
encoding used is UTF-16 since that's what Java chars are?
Original comment by cgdec...@gmail.com
on 13 Sep 2012 at 6:53
Yup - I think saying it's UTF_16LE is even more accurate.
Original comment by kak@google.com
on 13 Sep 2012 at 7:36
The point being that no encoding process of the characters is happening.
However the bytes are represented already is what is hashed.
Original comment by kevinb@google.com
on 14 Sep 2012 at 12:13
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:13
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
kamil....@gmail.com
on 13 Sep 2012 at 11:26