[Cryptography-dev] x509 Certificate Fingerprint Format

Robert Simmons rsimmons0 at gmail.com
Tue Feb 12 16:52:29 EST 2019


I raise you python 3.6+ using str.format() for best readability.
':'.join('{:2X}'.format(b) for b in s)

On Tue, Feb 12, 2019 at 4:18 PM Alexander Nigl <python-cryptography at qu3.org>
wrote:

> I take your
>
> > Python 3:
> > ':'.join('%02x' % b for b in s)
>
> and raise you >=Python 3.6
>
> ':'.join(f'{b:02X}' for b in s)
>
> Sry, had to do it ;)
>
> Alexander
>
> Ps: 02x is lowercase, 02X uppercase
> _______________________________________________
> Cryptography-dev mailing list
> Cryptography-dev at python.org
> https://mail.python.org/mailman/listinfo/cryptography-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cryptography-dev/attachments/20190212/d53ad610/attachment.html>


More information about the Cryptography-dev mailing list