base-n
base-n copied to clipboard
encoding breaks with arrays of broader type
I don't know if its planned or unexpected, but just changing uint16_t
to uint32_t
or to int
int arr[] { 1, 2, 3, 4, 65535 };
will result in a decoding mismatch.
1 2 3 4 4294967295
This is sadly result of a missing feature and a consistency check omission. The library only support char-sized input. I added a static_assert to that should make the error you posted not show. For reference, one way to properly the issue would be to iterate over bytes of the input data. Obviously, patches welcome! :)