[PATCH] D126254: Add support for decoding base64.

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 05:41:27 PDT 2022


serge-sans-paille added inline comments.


================
Comment at: llvm/include/llvm/Support/Base64.h:69
+      52,  53,  54,  55,  56,  57,  58,  59,  // 01234567
+      60,  61,  Inv, Inv, Inv, 0,   Inv, Inv, // 89...=..
+      Inv, 0,   1,   2,   3,   4,   5,   6,   // .ABCDEFG
----------------
clayborg wrote:
> serge-sans-paille wrote:
> > Would that make sens to set `'='` as `Inv` here? That would prevent you from the initial find
> We can't, we need it to decode to zero so we can always decode 3 bytes worth of output. We then drop any extra zero bytes based on "NumBytesToStrip" at the end. It also keeps the logic much cleaner in the main decode loop since we don't have to check.
I understand your point. Doing two pass over the sequence just for the sake of error checking bothers me a bit, I'd rather have a different handler for the tail. Do you have any idea of the length of a typical sequence? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126254/new/

https://reviews.llvm.org/D126254



More information about the llvm-commits mailing list