<div dir="ltr"><div dir="ltr">And a tiny bug, so I lose. :)<div>':'.join('{:02X}'.format(b) for b in s)<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 12, 2019 at 4:52 PM Robert Simmons <<a href="mailto:rsimmons0@gmail.com">rsimmons0@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">I raise you python 3.6+ using str.format() for best readability.<div>':'.join('{:2X}'.format(b) for b in s)<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 12, 2019 at 4:18 PM Alexander Nigl <<a href="mailto:python-cryptography@qu3.org" target="_blank">python-cryptography@qu3.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I take your<br>
<br>
> Python 3:<br>
> ':'.join('%02x' % b for b in s)<br>
<br>
and raise you >=Python 3.6<br>
<br>
':'.join(f'{b:02X}' for b in s)<br>
<br>
Sry, had to do it ;)<br>
<br>
Alexander<br>
<br>
Ps: 02x is lowercase, 02X uppercase<br>
_______________________________________________<br>
Cryptography-dev mailing list<br>
<a href="mailto:Cryptography-dev@python.org" target="_blank">Cryptography-dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/cryptography-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/cryptography-dev</a><br>
</blockquote></div>
</blockquote></div>