Module aoc::util

source ·
Expand description

§Utility modules to handle common recurring Advent of Code patterns.

Modules§

  • Add biterator method that treats an integer as a set, iterating over each element where the respective bit is set. For example 1101 would return 0, 2 and 3.
  • Fast 2 dimensional Grid backed by a single vec. This module is designed to work with Point.
  • Provides fast HashSet and HashMap implementations based on a simplified implementation of the fast Rust C hash algorithm also used by Firefox. By default, Rust’s HashMap and HashSet use a DDoS resistant but slower hashing algorithm. FxHasher is much faster (between 2x to 5x from my testing).
  • Min heap more suitable for algorithms such as Dijkstra and A* than Rust’s default max heap. Splits the sorting key and value, so that you can order items without having to implement Ord on the value type.
  • Combines common operators and constants 0, 1 and 10 to enable generic methods on integer types.
  • Add a chunk method to Iterator that duplicates the functionality of the unstable array_chunks method.
  • Extended mathematical operations.
  • MD5 hash algorithm
  • Extracts and parses signed and unsigned integers from surrounding text and whitespace.
  • Comprehensive 2 dimensional point implementation. This class is designed to work together with the Grid class.
  • Extension methods for slices.
  • Utility methods to spawn a number of scoped threads equals to the number of cores on the machine. Unlike normal threads, scoped threads can borrow data from their environment.