red-blox / zap

A lightning fast networking solution for roblox.
https://zap.redblox.dev
MIT License
88 stars 14 forks source link

[FEAT] Implement Integer Bit Sizes 24, 40, 48, 56, and 64 #67

Open SolarScuffle-Bot opened 7 months ago

SolarScuffle-Bot commented 7 months ago

Describe your feature

Allow for all byte sizes within [1, 8] for unsigned and signed integers. This simply grants finer control over how many bytes network data may use to potentially save a lot of space.

Alternatives

There are no alternatives aside from rounding to 16 or 32 bits.

Implementation Details

Serializing and deserializing a non-power of 2 will require up to 3 buffer reads and writes, and the compiler will need to handle these cases.

jackdotink commented 7 months ago

What is the purpose of adding 64 bit integer values, as those values cannot be represented with luau?