MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / encode_fieldnorm

Function encode_fieldnorm

nodedb-fts/src/block.rs:260–262  ·  view source on GitHub ↗

Encode a document length as a SmallFloat fieldnorm byte.

(doc_length: u32)

Source from the content-addressed store, hash-verified

258
259/// Encode a document length as a SmallFloat fieldnorm byte.
260pub fn encode_fieldnorm(doc_length: u32) -> u8 {
261 smallfloat::encode(doc_length)
262}
263
264/// Decode a SmallFloat fieldnorm byte back to approximate document length.
265pub fn decode_fieldnorm(byte: u8) -> u32 {

Callers 1

fieldnorm_encode_decodeFunction · 0.85

Calls 1

encodeFunction · 0.50

Tested by 1

fieldnorm_encode_decodeFunction · 0.68