@classmethod
def encode(cls, bytes_encoded):
    """
        encode a DNA bytes string using 3 bits per base.

        :param bytes bytes_encoded: a bytes string containing A, C, G, T, and N nucleotides.
        :return int: encoded string
        """
    encoded = 0
    for character in bytes_encoded:
        encoded <<= 3
        encoded += cls.encoding_map[character]
    return encoded
