

from collections.abc import Generator
from math import sin



def 				snake_case_(_UpperCamelCase					)							->     bytes:



  """simple docstring"""






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

  _snake_case						=							b''''''
  for i in [3, 2, 1, 0]:
    little_endian += string_aa[8 * i : 8 * i + 8]
  return little_endian



def 				snake_case_(_UpperCamelCase					)							->     bytes:



  """simple docstring"""






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

  _snake_case						=							format(_UpperCamelCase			,	'''08x'''					)[-8:]
  _snake_case						=							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 				snake_case_(_UpperCamelCase					)							->     bytes:



  """simple docstring"""






  _snake_case						=							b''''''
  for char in message:
    bit_string += format(_UpperCamelCase			,	'''08b'''					).encode('''utf-8'''					)
  _snake_case						=							format(len(_UpperCamelCase					)			,	'''064b'''					).encode('''utf-8'''					)

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

  return bit_string



def 				snake_case_(_UpperCamelCase					)							->     Generator[list[int], None, None]:



  """simple docstring"""






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

  for pos in range(0			,	len(_UpperCamelCase					)			,	512					):
    _snake_case						=							bit_string[pos : pos + 512]
    _snake_case						=							[]
    for i in range(0			,	512			,	32					):
      block_words.append(int(to_little_endian(block[i : i + 32]					)			,	2					)					)
    yield block_words



def 				snake_case_(_UpperCamelCase					)							->     int:



  """simple docstring"""






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

  _snake_case						=							format(_UpperCamelCase			,	'''032b'''					)
  _snake_case						=							''''''
  for c in i_str:
    new_str += "1" if c == "0" else "0"
  return int(_UpperCamelCase			,	2					)



def 				snake_case_(_UpperCamelCase			,	_UpperCamelCase					)							->     int:



  """simple docstring"""






  return (a + b) % 2**32



def 				snake_case_(_UpperCamelCase			,	_UpperCamelCase					)							->     int:



  """simple docstring"""






  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 				snake_case_(_UpperCamelCase					)							->     bytes:



  """simple docstring"""






  _snake_case						=							preprocess(_UpperCamelCase					)

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

  # Starting states
  _snake_case						=							0x6745_2301
  _snake_case						=							0xefcd_ab89
  _snake_case						=							0x98ba_dcfe
  _snake_case						=							0x1032_5476

  _snake_case						=							[
      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					):
    _snake_case						=							aa
    _snake_case						=							ba
    _snake_case						=							ca
    _snake_case						=							da

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

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

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


if __name__ == "__main__":
 import doctest

 doctest.testmod()




from math import factorial



def 				snake_case_(_UpperCamelCase			,	_UpperCamelCase					)							->     int:



  """simple docstring"""






  if n < k or k < 0:
    raise ValueError('''Please enter positive integers for n and k where n >= k'''					)
  return factorial(_UpperCamelCase					) // (factorial(_UpperCamelCase					) * factorial(n - k					))


if __name__ == "__main__":
 print(
     '''The number of five-card hands possible from a standard''',
     f'''fifty-two card deck is: {combinations(52, 5)}\n''',
 )

 print(
     '''If a class of 40 students must be arranged into groups of''',
     f'''4 for group projects, there are {combinations(40, 4)} ways''',
     '''to arrange them.\n''',
 )

 print(
     '''If 10 teams are competing in a Formula One race, there''',
     f'''are {combinations(10, 3)} ways that first, second and''',
     '''third place can be awarded.''',
 )

