homebrew hex encode for py3