This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

BinaryX : X indicates the length in bytes for the binary.

Hi, Forum.

Does anyone know how to define and handle odd bytes long binary data.
For example, Binary5 is 5 bytes long binary data.

I'm in project and in specs, there is this type of data.
Is this a mistake of document writer? I have no idea.

I'd like to hear you guys.
Thanks.

Parents Reply Children
  • Google will give you references to big-number libraries.

    Depending on what evaluations you need to do, it is also quite simple to write your own integer code for handling numbers larger than what the target hardware can do natively.

    You can do the same thing you do with pen and paper in the decimal number system, but instead of having 10 digits 0..9, you can use 256 digits (0..255) or 65536 digits (0..65535) or whatever you feel works best.

    It is preferable to select a number base where the processor can multiply two numbers and store the product, so if the processor only have 8x8 multiply giving 16-bit results, you shouldn't select a number base larger than 2^8, i.e. don't select "digits" larger than what fits in one byte.

    Depending on what big-num library you use, you will have to write code that picks up the data from the serial port, and imports/converts the data into the format used by the BN library. Same for outputting any results.