big-int 7.0.0

Simple library for arbitrary-precision, arbitrary-base arithmetic, supporting arbitrarily large integers of any base from 2 to u64::MAX.
Documentation
//! Various utility macros for testing.

/// Create a list of pairs of randomly generated ints, constrained
/// by the sizes of the associated int types passed.
#[macro_export(local_inner_macros)]
macro_rules! test_pairs {
    ($([$t:ty; $n:literal]),*) => {
        {
            ::std::iter::empty()$(.chain((0..$n).map(|_| (
                ::rand::random::<$t>() as i128,
                ::rand::random::<$t>() as i128
            ))))*
        }
    };
}

/// Create a list of randomly generated ints, constrained
/// by the sizes of the associated int types passed.
#[macro_export(local_inner_macros)]
macro_rules! test_values {
    ($([$t:ty; $n:literal]),*) => {
        {
            ::std::iter::empty()$(.chain((0..$n).map(|_|
                ::rand::random::<$t>() as i128,
            )))*
        }
    };
}

/// Format out a vec of bytes as a list of binary numbers.
#[macro_export(local_inner_macros)]
macro_rules! bytestr {
    ($d:expr) => {
        $d.iter()
            .map(|d| format!("{d:08b}"))
            .collect::<Vec<_>>()
            .join(" ");
    };
}

/// dbg! but don't multiline-print
#[macro_export(local_inner_macros)]
macro_rules! sdbg {
    ($val:expr) => {
        match $val {
            tmp => {
                ::std::eprintln!(
                    "[{}:{}] {} = {:?}",
                    ::std::file!(),
                    ::std::line!(),
                    ::std::stringify!($val),
                    &tmp
                );
                tmp
            }
        }
    };
}