-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from sniceio/hexdump_lowercase
Allowing to dump a string to hex using lowercase alphabet
- Loading branch information
Showing
2 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
snice-commons/src/test/java/com/google/polo/pairing/HexDumpTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.google.polo.pairing; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* @author [email protected] | ||
*/ | ||
public class HexDumpTest { | ||
|
||
@Test | ||
public void testDumpHexString() { | ||
final var bytes = new byte[] { 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, (byte) 0xFF }; | ||
assertEquals("0x0A0B0C0D0EFF", HexDump.toHexString(bytes)); | ||
assertEquals("0x0a0b0c0d0eff", HexDump.toHexString(bytes, false)); | ||
} | ||
|
||
} |