• 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.

    Parameters

    • text: string

      Input text to hash

    Returns Promise<Uint8Array>

    First 4 bytes of SHA-256 hash

    const key = await sha256First4Bytes("search term");