In MySQL 8.x the string function FROM_BASE64(str) returns result in hexadecimal form instead of a string
I have the following queries –
I have the following queries –
the output of select hex(user()) is 726F6F74406C6F63616C686F7374
and select unhex(‘726F6F74406C6F63616C686F7374’) will produce [email protected].
I was thinking about how I’m storing passwords in my database : appropriately salted SHA1 strings in a CHAR(40) field. However, since the character data in there is actually just a hex representation of a 160 bit number, I thought it might be better to store it as BINARY(20).
I have a table with a VARBINARY column. I need to insert a string such as ‘4D2AFF’ which represents the hex values 0x4D, 0x2A and 0xFF respectively. How do I construct this statement?
I have a UUID string that I want to use as my MySQL tables primary key, the UUID is a 32 character hexadecimal string (after ‘-‘ characters are stripped). Due to the fact that it is better to use a numeric column (int) as your primary key in a database, I would like to convert this to an integer but not sure of the best way to handle it.
I have this PHP code:
I’m investigating encodings in PHP5. Is there some way to get a raw hex dump of a string? i.e. a hex representation of each of the bytes (not characters) in a string?
I’m working on a project where I need to generate an undefined number of random, hexadecimal color codes…how would I go about building such a function in PHP?
What would be a good way to convert hex color values like #ffffff
into the single RGB values 255 255 255
using PHP?
I have some large HEX values that I want to display as regular numbers, I was using hexdec() to convert to float, and I found a function on PHP.net to convert that to decimal, but it seems to hit a ceiling, e.g.: