beve-org / beve

High performance, tagged binary data specification
MIT License
49 stars 1 forks source link

Clarify role of SIZE for arrays and objects #4

Closed ColinH closed 9 months ago

ColinH commented 9 months ago

For arrays and objects the SIZE field can be interpreted in one of two ways,

  1. the number of array elements or object members, or
  2. the total number of bytes of all array elements or object members.

I'm assuming the first option is used, but would greatly prefer and suggest this to be explicitly stated in README.md.

stephenberry commented 9 months ago

Excellent point. You are correct. I have added the following clarification to the README:

SIZE refers to the count of array members, object members, or characters in a string. It does not refer to the number of raw bytes.

ColinH commented 9 months ago

Great for arrays and objects!

Though for UTF-8 strings I have to ask, are you sure you want to count "characters"?

stephenberry commented 9 months ago

Valid point, it's only a character count for ASCII. I'll change the wording.