corey@corey-ThinkPad-T440s:~/pkg/rocky/upstream/castellan/castellan/key_manager$ python3
Python 3.6.7rc1 (default, Sep 27 2018, 09:51:25)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import binascii
>>> binascii.hexlify('string'.encode('utf-8'))
b'737472696e67'
>>> quit()
corey@corey-ThinkPad-T440s:~/pkg/rocky/upstream/castellan/castellan/key_manager$ python2
Python 2.7.15+ (default, Oct 2 2018, 22:12:08)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import binascii
>>> binascii.hexlify('string'.encode('utf-8'))
'737472696e67'
This works better:
corey@corey- ThinkPad- T440s:~ /pkg/rocky/ upstream/ castellan/ castellan/ key_manager$ python3 hexlify( 'string' .encode( 'utf-8' ))
Python 3.6.7rc1 (default, Sep 27 2018, 09:51:25)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import binascii
>>> binascii.
b'737472696e67'
>>> quit()
corey@corey- ThinkPad- T440s:~ /pkg/rocky/ upstream/ castellan/ castellan/ key_manager$ python2 hexlify( 'string' .encode( 'utf-8' ))
Python 2.7.15+ (default, Oct 2 2018, 22:12:08)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import binascii
>>> binascii.
'737472696e67'