-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhashtest.java
More file actions
31 lines (24 loc) · 955 Bytes
/
hashtest.java
File metadata and controls
31 lines (24 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public class hashtest
{
static {
System.out.println(System.getProperty("java.library.path"));
System.loadLibrary("cityhash");
}
public static void modtest(String tt) {
long code = (cityhashJNI.CityHash64IdataMod(tt, tt.length(), 10));
System.out.println("code: " + code + " length: " + tt.length());
}
public static void main( String[] args )
{
System.out.println( "Hello World!" );
String tt = "hello world";
// UnsignedLong code = UnsignedLong.asUnsigned(cityhash.hashBytes(tt.getBytes(), 0, tt.length()).asLong());
// Long code = Math.abs(cityhash1.hashBytes(tt.getBytes(), 0, tt.length()).asLong());
// System.out.println("code: " + code);
// code = Math.abs(hashtt.cityHash64(tt.getBytes(), 0, tt.length()));
// System.out.println("code2: " + code);
modtest(tt);
modtest("hello");
modtest("world");
}
}