How can I get a Ruby program to treat an array of characters (or a character string, undifferentiated) as an array of C-style character literals? I desire the ability to input an ASCII string and then perform arithmetic on the byte values of individual characters. What is a good way to do this?
Note: I am not trying to convert an ASCII representation of a hexadecimal number into a numerical value. (Through “f”.hex == 15, for example.) I am trying to accomplish what in C I would accomplish by casting a character value to int.