Re: py2 to 3 base64 issues

2019-08-09 Thread Larry Martell
On Fri, Aug 9, 2019 at 3:17 PM MRAB wrote: > > On 2019-08-09 19:21, Larry Martell wrote: > > On Fri, Aug 9, 2019 at 12:23 PM Chris Angelico wrote: > >> > >> On Sat, Aug 10, 2019 at 2:09 AM Larry Martell > >> wrote: > >> > > >> > I have some python 2 code: > >> > > >> > def decode(key, string):

Re: py2 to 3 base64 issues

2019-08-09 Thread MRAB
On 2019-08-09 19:21, Larry Martell wrote: On Fri, Aug 9, 2019 at 12:23 PM Chris Angelico wrote: On Sat, Aug 10, 2019 at 2:09 AM Larry Martell wrote: > > I have some python 2 code: > > def decode(key, string): >decoded_chars = [] >string = base64.urlsafe_b64decode(string) >

Re: py2 to 3 base64 issues

2019-08-09 Thread Larry Martell
On Fri, Aug 9, 2019 at 12:23 PM Chris Angelico wrote: > > On Sat, Aug 10, 2019 at 2:09 AM Larry Martell wrote: > > > > I have some python 2 code: > > > > def decode(key, string): > >decoded_chars = [] > >string = base64.urlsafe_b64decode(string) > >for i in range(len(strin

Re: py2 to 3 base64 issues

2019-08-09 Thread MRAB
On 2019-08-09 17:06, Larry Martell wrote: I have some python 2 code: def decode(key, string): decoded_chars = [] string = base64.urlsafe_b64decode(string) for i in range(len(string)): key_c = key[i % len(key)] encoded_c = chr(abs(ord(string[i]) - o

Re: py2 to 3 base64 issues

2019-08-09 Thread Chris Angelico
On Sat, Aug 10, 2019 at 2:09 AM Larry Martell wrote: > > I have some python 2 code: > > def decode(key, string): >decoded_chars = [] >string = base64.urlsafe_b64decode(string) >for i in range(len(string)): >key_c = key[i % len(key)] >encoded_c = chr(

py2 to 3 base64 issues

2019-08-09 Thread Larry Martell
I have some python 2 code: def decode(key, string): decoded_chars = [] string = base64.urlsafe_b64decode(string) for i in range(len(string)): key_c = key[i % len(key)] encoded_c = chr(abs(ord(string[i]) - ord(key_c) % 256)) decoded_chars.append