Closed webmaster128 closed 2 years ago
This looks rad. I think exponent notation (like 3.7e-201
or whatever) might make the long floats easier to read and maybe NaN
should be filtered. There are more guesses for numbers too, like in a certain range, it could be a date, or if it's 0/1 it could be boolean, but those could be left unsaid.
True, much guessing could be done from here. But the important step is to preserve the information instead of showing everything as integers.
In the last commit I changed the values to [u8; 8]
and [u8; 4]
, which are fixed length byte arrays of 8 and bytes. This should be much better 1. to avoid interpreting them too early as unsigned int and 2. to pass them to JS without loosing information. Maybe this helps to interprete them later without a bigint library: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array
With this extra information we can show fixed64/32 different than varints.
Here you see the unisgned / signed / float interpretation in yellow: