base64: Speed up decoder by using a table.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 9 Apr 2016 18:44:28 +0000 (20:44 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 23 Aug 2016 14:51:24 +0000 (16:51 +0200)
commitd865486282660af20194463e8e36a6d84ab579c8
tree97bb1e2b14170c8ad8fa344ed59e1e7f69b5bc0c
parenteacc2982fbf7e0c0b69508b57f85e839d1ba1013
base64: Speed up decoder by using a table.

The current implementation calls strchr() for each character in the
decoded data to find the offset in the Base64[] array that corresponds
to six decoded bits. This makes the algorithm scale poorly.

This commit introduces a lookup table of size 256 which simplifies
the code and improves the performance of the decoder.
base64.c