How-to articles, tricks, and solutions about HEX

Convert a string representation of a hex dump to a byte array using Java?

To convert a string representation of a hex dump to a byte array in Java, you can use the DatatypeConverter class's parseHexBinary method.

Convert hex string to integer in Python

You can use the int() function in Python to convert a hex string to an integer.

Converting A String To Hexadecimal In Java

To convert a string to a hexadecimal string in Java, you can use the encodeHexString method of the org.apache.commons.codec.binary.Hex class.

Generating a random hex color code with PHP

You can use the dechex function in PHP to convert a random number to a hexadecimal value, and then use that value as a color code.

How to convert a byte array to a hex string in Java?

To convert a byte array to a hexadecimal string in Java, you can use the following method:

PHP convert string to hex and hex to string

To convert a string to its hexadecimal representation, you can use the bin2hex function in PHP.