Skip to content

Instantly share code, notes, and snippets.

@Pablohn26
Last active December 17, 2021 02:26
Show Gist options
  • Save Pablohn26/26cd6220a26e8c547921cd91c70abb20 to your computer and use it in GitHub Desktop.
Save Pablohn26/26cd6220a26e8c547921cd91c70abb20 to your computer and use it in GitHub Desktop.
FROM maven:3.3.3
WORKDIR /
COPY ./tlsh/src src
COPY ./pom.xml ./
RUN mkdir -p /src/com/idealista/tlsh/
RUN mvn -f pom.xml clean package install
WORKDIR /target
COPY ./SimpleTest.java ./
RUN javac -cp tlsh-1.0.0.jar SimpleTest.java
RUN jar cvf SimpleTest.jar SimpleTest.class
RUN java -cp "tlsh-1.0.0.jar:SimpleTest.jar" SimpleTest
import com.idealista.tlsh.*;
public class SimpleTest{
public static void main(String args[]){
String data = "The best documentation is the UNIX source. After all, this is what the "
+ "system uses for documentation when it decides what to do next! The "
+ "manuals paraphrase the source code, often having been written at "
+ "different times and by different people than who wrote the code. "
+ "Think of them as guidelines. Sometimes they are more like wishes... "
+ "Nonetheless, it is all too common to turn to the source and find "
+ "options and behaviors that are not documented in the manual. Sometimes "
+ "you find options described in the manual that are unimplemented "
+ "and ignored by the source.";
TLSH tlsh = new TLSH(data);
String hash = tlsh.hash();
System.out.println (hash);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment