pub fn vec_to_blob(vec: &[f32]) -> Vec<u8> ⓘExpand description
Encode a float vector as a BLOB (little-endian f32 bytes).
Each f32 is stored as 4 bytes in little-endian order, producing
a BLOB of vec.len() × 4 bytes.
§Example
use context_harness_core::embedding::{vec_to_blob, blob_to_vec};
let v = vec![1.0f32, -2.5, 3.125];
let blob = vec_to_blob(&v);
assert_eq!(blob.len(), 12); // 3 × 4 bytes
assert_eq!(blob_to_vec(&blob), v);