base-n icon indicating copy to clipboard operation
base-n copied to clipboard

encoding breaks with arrays of broader type

Open pbertoni89 opened this issue 6 years ago • 2 comments

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

pbertoni89 avatar Jun 04 '18 08:06 pbertoni89

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! :)

azawadzki avatar Aug 11 '18 19:08 azawadzki