//! 2-bit encoding helpers shared across obiskbuilder.

/// Maximum bytes needed for a 256-nucleotide super-kmer (256/4 = 64).
pub const BYTE_LEN_MAX: usize = 64;

/// Encode one uppercase ASCII nucleotide to its 2-bit value.
#[inline]
pub(crate) fn encode_nuc(b: u8) -> u8 {
    match b {
        b'A' => 0b00,
        b'C' => 0b01,
        b'G' => 0b10,
        b'T' => 0b11,
        _ => 0b00,
    }
}
