commit fd8c563be73c04c58cafedfb883c96a07c9bdbff Author: ehlxr Date: Mon Nov 14 13:36:35 2022 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/READEME.md b/READEME.md new file mode 100644 index 0000000..ce4e8af --- /dev/null +++ b/READEME.md @@ -0,0 +1 @@ +`native-image -cp "target/classes:lib/*" io.github.ehlxr.murmur3.Murmur3Applicatio` built as a standalone executable \ No newline at end of file diff --git a/lib/guava-31.0.1-jre.jar b/lib/guava-31.0.1-jre.jar new file mode 100644 index 0000000..324887d Binary files /dev/null and b/lib/guava-31.0.1-jre.jar differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..010220f --- /dev/null +++ b/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + io.github.ehlxr + murmur3 + 0.0.1-SNAPSHOT + murmur3 + murmur3 + + 1.8 + + 1.8 + 1.8 + + + + com.google.guava + guava + 31.1-jre + + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.3 + + false + + + + package + + shade + + + + + io.github.ehlxr.murmur3.Murmur3Application + + + + + + + + + + diff --git a/src/main/java/io/github/ehlxr/murmur3/Murmur3Application.java b/src/main/java/io/github/ehlxr/murmur3/Murmur3Application.java new file mode 100644 index 0000000..1b60dad --- /dev/null +++ b/src/main/java/io/github/ehlxr/murmur3/Murmur3Application.java @@ -0,0 +1,15 @@ +package io.github.ehlxr.murmur3; + +import com.google.common.base.Charsets; +import com.google.common.hash.Hashing; + +/** + * @author ehlxr + */ +public class Murmur3Application { + public static void main(String[] args) { + for (String arg : args) { + System.out.println(arg + " => " + Math.abs(Hashing.murmur3_32_fixed().hashString(arg, Charsets.UTF_8).asInt())); + } + } +}