I have no clue how to validate this string. I am simply supplying an IV for an encryption, but can find no 1is_hex()1 or similar function, I can’t wrap my head around it! I read on a comment in the php documentation (user contrib. notes) this:
if($iv == dechex(hexdec($iv))) {
//True
} else {
//False
}
But that doesn’t seem to work at all.. It only says false.
If it helps my input of my IV would be this:
92bff433cc639a6d
Use function : ctype_xdigit
The above example will output:
AB10BC99consists of all hexadecimal digits.AR1012does not consist of all hexadecimal digits.ab12bc99consists of all hexadecimal digits.