Skip to main content

Crate nitro_hash

Crate nitro_hash 

Source
Expand description

§nitro_hash

A lightweight algebraic fingerprinting / hash system based on polynomial interpolation over a finite field.

§Overview

This crate builds a configurable hash by:

  • Interpreting input as field elements
  • Constructing a randomized polynomial
  • Evaluating via Lagrange interpolation
  • Encoding outputs as bytes

§Output sizes

Each configuration uses K evaluation points:

  • 2 → 122-bit hash
  • 3 → 183-bit hash
  • 4 → 244-bit hash
  • 5 → 305-bit hash

Structs§

HashConfig
Configuration for the hashing system.

Functions§

hex
Converts a 32-byte array into a hex string.
str_to_vec_i64
Converts a string into a vector of u64 blocks.
to_vec_u8
Converts a vector of u64 field elements into raw bytes.