nagyistoce / stringencoders

Automatically exported from code.google.com/p/stringencoders
Other
0 stars 0 forks source link

Duplicate base64 encoding tables? #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I notice the e1 and e2 encoding tables are the same thing byte for byte. Is 
that intentional (if so why have e2 at all? I ditched it when I ported the 
code) or was it a typo?

Original issue reported on code.google.com by dan.el...@gmail.com on 19 Mar 2013 at 12:58

GoogleCodeExporter commented 9 years ago
Actually all the encoding tables seem to be redundant. I see no cpu time that 
can be saved by using them. See the code here: 
http://base64.sourceforge.net/b64.c

It's clearer to understand without the extra tables, and the bit ops are nearly 
identical (both your and his files have redundant masks that can be eliminated 
actually, they're not required with the right shifts, so my ported algorithm 
has fewer operations and only one 64 byte table.)

Anyway not trying to be hard on you, I was just genuinely puzzled by your code.

Original comment by dan.el...@gmail.com on 19 Mar 2013 at 4:13