qntm / base32768

Binary-to-text encoding highly optimised for UTF-16
MIT License
138 stars 5 forks source link

How to differentiate between `0011(111)` being decoded at the end of a stream and `00(11111)`? #3

Closed s5bug closed 5 years ago

s5bug commented 5 years ago

I'm writing a port that works on bit streams instead of bytes and I have a problem when I'm not using 15*n +? 7 bits; decoding the string leads to an ambiguity. How can I solve this?

qntm commented 5 years ago

I'm not sure I fully understand the question. Can you give an example of a Base32768 string which has ambiguous decoding? It would also be helpful if you provided an example input binary which encodes to that Base32768 string.

s5bug commented 5 years ago

@qntm The problem comes from me using bits and not bytes, sorry; I should have closed this a while ago myself. This algorithm is not intended for bits