Skip to main content
added 9 characters in body
Source Link
user281377
  • 28.4k
  • 5
  • 77
  • 130

How about that: One byte for length, then n bytes for the number (least significant byte first). Repeat length+number as long as the previous length was 255.

This allows for arbitrarily large numbers, but is still easy to handle and doesn't waste too much memory.

How about that: One byte for length, then n bytes for the number (least significant byte first). Repeat length+number as long as the length was 255.

This allows for arbitrarily large numbers, but is still easy to handle and doesn't waste too much memory.

How about that: One byte for length, then n bytes for the number (least significant byte first). Repeat length+number as long as the previous length was 255.

This allows for arbitrarily large numbers, but is still easy to handle and doesn't waste too much memory.

Source Link
user281377
  • 28.4k
  • 5
  • 77
  • 130

How about that: One byte for length, then n bytes for the number (least significant byte first). Repeat length+number as long as the length was 255.

This allows for arbitrarily large numbers, but is still easy to handle and doesn't waste too much memory.