I somewhat routinely need to convert an arbitrarily long string to hex, usually encoded as ascii or unicode.
Is there a way to quickly and easily do this using vanilla Emacs? If not, is there a go to package that can do this?
There was a prior question about converting a single character to its hex value, but this question is interested in converting arbitrarily long strings to hex.
Examples ("input string" output hex):
- "bird" 62697264
- "What are we going to do tomorrow night? The same thing we do every night Pinky, try to take over the world!" 576861742061726520776520676f696e6720746f20646f20746f6d6f72726f77206e696768743f205468652073616d65207468696e6720776520646f206576657279206e696768742050696e6b792c2074727920746f2074616b65206f7665722074686520776f726c6421
- "おはようございます"
- (utf8) e3818ae381afe38288e38186e38194e38196e38184e381bee38199
- (utf16 be) 304a306f30883046305430563044307e3059