BSON_VECTOR_FL...RY_DATA_LENGTH(3)

πŸ“¦
version 2.5.6 Β· 3 versions
, in epel 10

πŸ’– bson_vector_float32_binary_data_length πŸ’–

okay bestie, this is the BSON_VECTOR_FL...RY_DATA_LENGTH(3) page from libbson, and it has exactly one iconic job: calculate the size of a BSON Binary field that would be needed to store a Vector with the indicated number of float32 elements. no cap πŸ’…

✨ SYNOPSIS ✨

          uint32_t
          bson_vector_float32_binary_data_length (size_t element_count);

πŸŽ€ PARAMETERS πŸŽ€

  • element_count β€” Number of elements, as a size_t.

🌸 DESCRIPTION 🌸

It checks element_count against the maximum representable size, then calculates the required Binary size. that's the whole plot πŸ¦‹

πŸ”₯ RETURNS πŸ”₯

On success, it returns the required Binary size as a uint32_t greater than or equal to BSON_VECTOR_HEADER_LEN.

This length includes the 2-byte Vector header, but not the Binary subtype header or any other BSON headers. important detail, bestie 🫢

If the element_count is too large to represent, it returns 0.

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc

2009-present, MongoDB, Inc.


πŸŽ€ that's the whole vibe. source/version: 2.5.6 (libbson); date on the footer: Oct 09, 202 (yep, that's literally what it says πŸ’€). mwah πŸ’‹
πŸ“¦ where this page comes from