> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Function poseidon2_hash_bytes

Module: `protocol_types::hash`

```rust
pub fn poseidon2_hash_bytes<let N: u32>(inputs: [u8; N]) -> Field
```

Computes a Poseidon2 hash of a fixed string, such as a function signature or a domain separator name.

The bytes are packed into 31-byte little-endian chunks, one `Field` per chunk, and the result is [`poseidon2_hash`](/aztec-nr-api/v6.0.0/protocol_types/hash/fn.poseidon2_hash.md) of those fields.

The hash commits to the number of chunks but not to the byte length `N`: zero bytes at the end of the last chunk do not change the result, so `[1]`, `[1, 0]` and `[1, 0, ..., 0]` (31 bytes) all hash to the same value. Do not use this to commit to variable-length data, e.g. a payload zero-padded to a maximum length, unless the length is bound separately.
