Computes SHA-256 hash of input text and returns first 4 bytes. Used for creating search keys from text input. The hash is truncated to 4 bytes as that's sufficient for the B-tree search implementation.
Input text to hash
First 4 bytes of SHA-256 hash
const key = await sha256First4Bytes("search term"); Copy
const key = await sha256First4Bytes("search term");
Computes SHA-256 hash of input text and returns first 4 bytes. Used for creating search keys from text input. The hash is truncated to 4 bytes as that's sufficient for the B-tree search implementation.