tamtam180 / cityhash-for-java Goto Github PK
View Code? Open in Web Editor NEWCityHashのJava実装 / same as v1.0.0 version, not same v1.1.1
CityHashのJava実装 / same as v1.0.0 version, not same v1.1.1
I have try to use this cityhash64 func, but find out the result is inconsist. Can u please take a look.
from cityhash import CityHash32, CityHash64, CityHash128
print(CityHash64('abc'))
print(CityHash64('123'))
public static void main(String[] args) {
String itemId = "123";
byte[] bytes = itemId.getBytes(StandardCharsets.UTF_8);
for (int i = 0; i < bytes.length; i++) {
System.out.println(bytes[i]);
}
System.out.println(toUnsignedString(cityHash64(itemId.getBytes(), 0, itemId.length())));
System.out.println(toUnsignedString(cityHash64("abc".getBytes(), 0, itemId.length())));
}
Regarding below function cityHash64WithSeed,
public static long cityHash64WithSeed(byte[] s, int pos, int len, long seed)
May I know why it has addtional parameter "pos" comparing with one in C++ ?
And what is the purpose of "pos"?
Below is original C++ code of this function for your information:
uint64 CityHash64WithSeed(const char *s, size_t len, uint64 seed) {
return CityHash64WithSeeds(s, len, k2, seed);
}
thanks a lot.
can you publish your file to maven?
original 1.0.0 / at Apr 6, 2011: google/cityhash@6efae23
And my code committed at Apr 6, 2012.
After then, the original implementation has been upgraded several times and the hash value has changed.
Histories:
see: https://github.com/google/cityhash/blob/master/NEWS
Note which version of the implementation is compatible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.