Created
July 4, 2020 12:58
-
-
Save gdouzwt/e6656f6b46d5b79acda549dd71c01d54 to your computer and use it in GitHub Desktop.
Converting A String to Hexadecimal in 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
public String toHex(String arg) { | |
return String.format("%040x", new BigInteger(1, arg.getBytes(/*YOUR_CHARSET?*/))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment