def rmask_byte(num_mask_bits,value):
    """
    This function applies a right-justified mask of a specified number of bits to an unsigned integer representing a single byte value.
    >>> rmask_byte(3,list(b'\\xff')[0])
    7
    >>> bin(7)
    '0b111'
    """
    return ((1<<(num_mask_bits))-1) & value