Skip to content

Commit

Permalink
backup
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkhala committed Jun 4, 2024
1 parent 0874b49 commit f9f05b3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
21 changes: 21 additions & 0 deletions crypto/src/test/java/FormatTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import org.davidkhala.Hash;
import org.davidkhala.Hex;
import org.junit.jupiter.api.Test;

import java.security.NoSuchAlgorithmException;

import static org.junit.jupiter.api.Assertions.*;

class FormatTest {
@Test
void testMD5() throws NoSuchAlgorithmException {
String message = "p4ssw0rd";
assertEquals("2a9d119df47ff993b662a8ef36f9ea20", Hex.encode(Hash.MD5(message.getBytes())));
}

@Test
void testHex() {
String message = "p4ssw0rd";
assertEquals(message, Hex.decode(Hex.encode(message.getBytes())));
}
}
13 changes: 0 additions & 13 deletions crypto/src/test/java/HashTest.java

This file was deleted.

0 comments on commit f9f05b3

Please sign in to comment.