Last active
June 19, 2018 14:38
-
-
Save erlangparasu/edbf520b046015a7513482cbb188c174 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| public static String asciiStringToHexString(String strAscii) { | |
| char[] chars = strAscii.toCharArray(); | |
| StringBuilder stringBuilder = new StringBuilder(); | |
| for (char aChar : chars) { | |
| String aHex = String.format("%H", aChar); | |
| stringBuilder.append(aHex); | |
| } | |
| String strHex = stringBuilder.toString(); | |
| return strHex; | |
| } | |
| // Ref: https://www.boraji.com/how-to-convert-ascii-to-hex-in-java |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment