• ###### flibustiercommented on "Compress an array of numbers into an efficient Base 64 " kata

`DC=` means `D` => 4 bits encoding so there is no confusion possible as we have 6 bits of length, `C` means 00 00 11, result is `[0]` (the `=` could be safely ignored)
`ChwLA=` => 3 bits
`hwLA` => 100 001 110 000 001 011 000 000
=> could be `[4, 1, 6, 0, 1, 3, 0, 0]` but as we have the `=` flag,
we know we could remove the trailling zeros so the real result is `[4, 1, 6, 0, 1, 3]`
So the `=` as a real meaning in this case here to differenciate `[4, 1, 6, 0, 1, 3]` from `[4, 1, 6, 0, 1, 3, 0]` or from `[4, 1, 6, 0, 1, 3, 0, 0]`

• ###### flibustiercommented on "Compress an array of numbers into an efficient Base 64 " kata

Yes exactly, that’s why when you said "wouldn't it just be fun if non-ambiguous endings could be encoded the same way ambiguous endings have to be?" it doesn’t seem to be possible !

• ###### flibustiercommented on "Compress an array of numbers into an efficient Base 64 " kata

Hello @Johan Wiltink

Indeed, I could remove the requirement of empty string when we have an empty array in the encoder !

We could encode non-ambiguous endings the same way as ambiguous when the last chunk is not exactly 6 bits, but when it does, we need a flag (or a way) to determine if we have to remove last bits or not at decoding time, how else would you do it ?

• ###### flibustierresolved an issue on "Compress an array of numbers into an efficient Base 64 " kata

I added random testing, thank you for pointing this out !