






"""simple docstring"""





def     __lowercase					(    a :				bytes )					->					str:
      return "".join([hex(a )[2:].zfill(2 ).upper() for byte in list(a )] )



def     __lowercase					(    a :				str )					->					bytes:
      # Check data validity, following RFC3548
      # https://www.ietf.org/rfc/rfc3548.txt
      if (len(a ) % 2) != 0:
            raise ValueError(
                '''Base16 encoded data is invalid:
Data does not have an even number of hex digits.''' )
      # Check the character set - the standard base16 alphabet
      # is uppercase according to RFC3548 section 6
      if not set(a ) <= set('''0123456789ABCDEF''' ):
            raise ValueError(
                '''Base16 encoded data is invalid:
Data is not uppercase hex or it contains invalid characters.''' )
      # For every two hexadecimal digits (= a byte), turn it into an integer.
      # Then, string the result together into bytes, and return it.
      return bytes(int(data[i] + data[i + 1]       ,		16 ) for i in range(0       ,		len(a )       ,		2 ) )


if __name__ == "__main__":
    import doctest

    doctest.testmod()










"""simple docstring"""





from __future__ import annotations



def     __lowercase					(    a :				int       ,		a :				int )					->					list[str]:
      if partitions <= 0:
            raise ValueError('''partitions must be a positive number!''' )
      if partitions > number_of_bytes:
            raise ValueError('''partitions can not > number_of_bytes!''' )
      __snake_case      :    List[str]  			=number_of_bytes // partitions
      __snake_case      :    str  			=[]
      for i in range(a ):
            __snake_case      :    Optional[Any]  			=i * bytes_per_partition + 1
            __snake_case      :    Any  			=(
                number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition
            )
            allocation_list.append(f'''{start_bytes}-{end_bytes}''' )
      return allocation_list


if __name__ == "__main__":
    import doctest

    doctest.testmod()


