tiny-binary-format icon indicating copy to clipboard operation
tiny-binary-format copied to clipboard

Add warnings or errors for numbers that are going to break

Open danprince opened this issue 8 years ago • 1 comments

Because Javascript doesn't support bitwise operations on numbers > 32 bit integers, we need to provide some kind of heads up when someone creates a format with a field length that will break.

If someone tries to create a field that's not a number, is a floating point number, or is an integer bigger than we can manipulate with a bitwise operators, then throw some pretty liberal errors. As long as this stuff lives within the constructor, it should be fine.

If you can think of any other edge cases that could also be troublesome, leave a comment here or send a PR.

danprince avatar Aug 11 '15 09:08 danprince

Additionally, should pack() give warnings/throw errors if supplied invalid input? For example: input exceeding field range, input NaN/noninteger, input count does not match field count, etc?

austinliou avatar Aug 13 '15 00:08 austinliou