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.

Revisions

  1. Pablohn26 revised this gist Dec 17, 2021. 1 changed file with 20 additions and 0 deletions.
    20 changes: 20 additions & 0 deletions SimpleTest.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    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);

    }
    }
  2. Pablohn26 created this gist Dec 17, 2021.
    11 changes: 11 additions & 0 deletions Dockerfile test idealista
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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