I have an input in the form of "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"(64 hexadecimal characters obtained from SHA-256) which I want to store in a database with MySqli. The column the value should be inserted to is of type BINARY(32). I think that the value is interpreted as a string, rather than a hex number, so MySQL returns "Data too long for column x at row y". How can I convert this string to 32 bytes in PHP? I already tried adding "0x" as a prefix, MySql's CONVERT function and I read about hex2bin and bin2hex, which don't seem to do what I want, and i tried both string and int types in bind_params (int results in 0x3000... regardless of the input)
Thanks in advance