http://www.perlmonks.org?node_id=1054722


in reply to Perl XOR

What does it mean to "XOR a string by 32 bits"? Does that mean "XOR a 4-byte string with a 32-bit value"? If so,

unpack('N', $s) ^ $val # Big-endian byte order -or- unpack('V', $s) ^ $val # Little-endian byte order

What does it mean to "take the inverse of the XOR result as a hexadecimal value"? Hexadecimal is a string representation of a number, and strings don't have inverses.