FYI, you might also like this version:

Python 3:
':'.join('%02x' % b for b in s)

Python 2:
':'.join('%02x' % ord(b) for b in s)


On Tue, Feb 12, 2019 at 10:29 AM Gilbert Mendoza <gmend...@gmail.com> wrote:

> Thank you, Alexander. Your solution is much cleaner.  Your Python Kung Fu
> is strong.  :-)
>
> hash = ":".join([hex(h)[2:].upper() for h in hash_bytes])
>> print(hash)
>> '76:E1:81:9F:AD:F0:6A:55:EF:4B:12:6A:2E:F7:43:C2:BA:E8:A1:51'
>>
>
> Thanks, again!
>
> Sincerely,
>
> Gilbert
> _______________________________________________
> Cryptography-dev mailing list
> Cryptography-dev@python.org
> https://mail.python.org/mailman/listinfo/cryptography-dev
>
_______________________________________________
Cryptography-dev mailing list
Cryptography-dev@python.org
https://mail.python.org/mailman/listinfo/cryptography-dev

Reply via email to