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

# Module arrays

Module: `protocol_types::utils::arrays`

## Structs

- [ClaimedLengthArray](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/struct.ClaimedLengthArray.md): ClaimedLengthArray - An array interpreted by Kernel circuits. Its `length` is merely a claim that must eventually be validated. Validation must include:

  - Asserting all items to the LHS of the length are nonempty (dense).
  - Asserting all items to the RHS of the length are empty.

- [SortedTuple](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/struct.SortedTuple.md)

## Functions

- [array_length](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.array_length.md): Helper function to count the number of non-empty elements in a validated array. Danger: This is only safe to call if the input arrays have been "validated" (dense lhs, empty rhs).

  1. All elements before the first empty element are non-empty
  2. All elements after and including the first empty element are empty
  3. The array forms a contiguous sequence of non-empty elements followed by empty elements

- [array_length_until](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.array_length_until.md)

- [array_padded_with](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.array_padded_with.md): Returns true iff every element of `array` at index `>= from_index` equals `padded_with`.

- [assert_trailing_zeros](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.assert_trailing_zeros.md): Asserts that all fields in `input` after the first `in_len` fields are zero.

- [check_permutation](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.check_permutation.md)

- [find_first_index](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.find_first_index.md): Helper function to find the index of the first element in an array that satisfies a given predicate. If the element is not found, the function returns the length of the array `N`

- [find_last_index](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.find_last_index.md): Helper function to find the index of the last element in an array that satisfies a given predicate. If the element is not found, the function returns the length of the array `N`

- [get_sorted_tuples](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.get_sorted_tuples.md): Sorts the input `array`, but also outputs an `original_index` field for each sorted item, so that you know where it came from.

- [splice_at_count](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.splice_at_count.md): Splices two fixed-size arrays at `count`.

- [subarray](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.subarray.md): Helper fn to create a subarray from a given array.

- [trimmed_array_length_hint](/aztec-nr-api/v6.0.0/protocol_types/utils/arrays/fn.trimmed_array_length_hint.md)
