

'''simple docstring'''







from collections.abc import Generator
from math import sin
def 					UpperCAmelCase__			(					UpperCAmelCase__ )	->	bytes:



       if len(_UpperCamelCase ) != 32:
              raise ValueError("""Input must be of length 32""" )

       A_		    =					b""""""
       for i in [3, 2, 1, 0]:
              little_endian += string_aa[8 * i : 8 * i + 8]
       return little_endian
def 					UpperCAmelCase__			(					UpperCAmelCase__ )	->	bytes:



       if i < 0:
              raise ValueError("""Input must be non-negative""" )

       A_		    =					format(_UpperCamelCase,				"""08x""" )[-8:]
       A_		    =					b""""""
       for i in [3, 2, 1, 0]:
              little_endian_hex += hex_rep[2 * i : 2 * i + 2].encode("""utf-8""" )
       return little_endian_hex
def 					UpperCAmelCase__			(					UpperCAmelCase__ )	->	bytes:
       A_		    =					b""""""
       for char in message:
              bit_string += format(_UpperCamelCase,				"""08b""" ).encode("""utf-8""" )
       A_		    =					format(len(_UpperCamelCase ),				"""064b""" ).encode("""utf-8""" )

       # Pad bit_string to a multiple of 512 chars
       bit_string += b"1"
       while len(_UpperCamelCase ) % 5_12 != 4_48:
              bit_string += b"0"
       bit_string += to_little_endian(start_len[32:] ) + to_little_endian(start_len[:32] )

       return bit_string
def 					UpperCAmelCase__			(					UpperCAmelCase__ )	->	Generator[list[int], None, None]:



       if len(_UpperCamelCase ) % 5_12 != 0:
              raise ValueError("""Input must have length that's a multiple of 512""" )

       for pos in range(0,				len(_UpperCamelCase ),				5_12 ):
              A_		    =					bit_string[pos : pos + 5_12]
              A_		    =					[]
              for i in range(0,				5_12,				32 ):
                     block_words.append(int(to_little_endian(block[i : i + 32] ),				2 ) )
              yield block_words
def 					UpperCAmelCase__			(					UpperCAmelCase__ )	->	int:



       if i < 0:
              raise ValueError("""Input must be non-negative""" )

       A_		    =					format(_UpperCamelCase,				"""032b""" )
       A_		    =					""""""
       for c in i_str:
              new_str += "1" if c == "0" else "0"
       return int(_UpperCamelCase,				2 )
def 					UpperCAmelCase__			(					UpperCAmelCase__,				UpperCAmelCase__ )	->	int:
       return (a + b) % 2**32
def 					UpperCAmelCase__			(					UpperCAmelCase__,				UpperCAmelCase__ )	->	int:



       if i < 0:
              raise ValueError("""Input must be non-negative""" )
       if shift < 0:
              raise ValueError("""Shift must be non-negative""" )
       return ((i << shift) ^ (i >> (32 - shift))) % 2**32
def 					UpperCAmelCase__			(					UpperCAmelCase__ )	->	bytes:
       A_		    =					preprocess(_UpperCamelCase )

       A_		    =					[int(2**32 * abs(sin(i + 1 ) ) ) for i in range(64 )]

       # Starting states
       A_		    =					0X67_45_23_01
       A_		    =					0XEF_CD_AB_89
       A_		    =					0X98_BA_DC_FE
       A_		    =					0X10_32_54_76

       A_		    =					[
           7,
           12,
           17,
           22,
           7,
           12,
           17,
           22,
           7,
           12,
           17,
           22,
           7,
           12,
           17,
           22,
           5,
           9,
           14,
           20,
           5,
           9,
           14,
           20,
           5,
           9,
           14,
           20,
           5,
           9,
           14,
           20,
           4,
           11,
           16,
           23,
           4,
           11,
           16,
           23,
           4,
           11,
           16,
           23,
           4,
           11,
           16,
           23,
           6,
           10,
           15,
           21,
           6,
           10,
           15,
           21,
           6,
           10,
           15,
           21,
           6,
           10,
           15,
           21,
       ]

       # Process bit string in chunks, each with 16 32-char words
       for block_words in get_block_words(_UpperCamelCase ):
              A_		    =					aa
              A_		    =					ba
              A_		    =					ca
              A_		    =					da

              # Hash current chunk
              for i in range(64 ):
                     if i <= 15:
                            # f = (b & c) | (not_32(b) & d)     # Alternate definition for f
                            A_		    =					d ^ (b & (c ^ d))
                            A_		    =					i
                     elif i <= 31:
                            # f = (d & b) | (not_32(d) & c)     # Alternate definition for f
                            A_		    =					c ^ (d & (b ^ c))
                            A_		    =					(5 * i + 1) % 16
                     elif i <= 47:
                            A_		    =					b ^ c ^ d
                            A_		    =					(3 * i + 5) % 16
                     else:
                            A_		    =					c ^ (b | not_aa(_UpperCamelCase ))
                            A_		    =					(7 * i) % 16
                     A_		    =					(f + a + added_consts[i] + block_words[g]) % 2**32
                     A_		    =					d
                     A_		    =					c
                     A_		    =					b
                     A_		    =					sum_aa(_UpperCamelCase,				left_rotate_aa(_UpperCamelCase,				shift_amounts[i] ) )

              # Add hashed chunk to running total
              A_		    =					sum_aa(_UpperCamelCase,				_UpperCamelCase )
              A_		    =					sum_aa(_UpperCamelCase,				_UpperCamelCase )
              A_		    =					sum_aa(_UpperCamelCase,				_UpperCamelCase )
              A_		    =					sum_aa(_UpperCamelCase,				_UpperCamelCase )

       A_		    =					reformat_hex(_UpperCamelCase ) + reformat_hex(_UpperCamelCase ) + reformat_hex(_UpperCamelCase ) + reformat_hex(_UpperCamelCase )
       return digest


if __name__ == "__main__":
      import doctest

      doctest.testmod()




"""simple docstring"""






from ..utils import DummyObject, requires_backends





class      lowerCamelCase__   (     metaclass=A				):







					"""simple docstring"""


					__a	       =							["""note_seq"""]






					def __init__(       self    : List[Any] ,       *UpperCamelCase    : List[Any] ,       **UpperCamelCase    : Tuple  ):
												'''simple docstring'''






												requires_backends(self ,       ["""note_seq"""]  )






					@classmethod
					def lowerCamelCase__							(       cls    : Union[str, Any] ,       *UpperCamelCase    : Union[str, Any] ,       **UpperCamelCase    : str  ):
												'''simple docstring'''






												requires_backends(cls ,       ["""note_seq"""]  )






					@classmethod
					def lowerCamelCase__							(       cls    : List[str] ,       *UpperCamelCase    : Optional[Any] ,       **UpperCamelCase    : Union[str, Any]  ):
												'''simple docstring'''






												requires_backends(cls ,       ["""note_seq"""]  )
