Module util

Source
Expand description

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

Modules§

ansi
ANSI escape codes
bitset
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.
grid
Fast 2 dimensional Grid backed by a single vec. This module is designed to work with Point.
hash
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).
heap
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.
integer
Combines common operators and constants 0, 1 and 10 to enable generic methods on integer types.
iter
Add a chunk method to Iterator that duplicates the functionality of the unstable array_chunks method.
math
Extended mathematical operations.
md5
MD5 hash algorithm
parse
Extracts and parses signed and unsigned integers from surrounding text and whitespace.
point
Comprehensive 2 dimensional point implementation. This class is designed to work together with the Grid class.
slice
Extension methods for slices.
thread
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.