






import argparse
import hashlib  # hashlib is only used inside the Test class
import struct


class     _a							:






  """simple docstring"""





  def __init__(  self		,		_UpperCAmelCase			)      ->			Optional[int]:
     UpperCamelCase_						=  data
     UpperCamelCase_						=  [0x6745_2301, 0xEFCD_AB89, 0x98BA_DCFE, 0x1032_5476, 0xC3D2_E1F0]




  @staticmethod
  def  _UpperCAmelCase  (  _UpperCAmelCase		,		_UpperCAmelCase			)      ->			Dict:
     return ((n << b) | (n >> (32 - b))) & 0xFFFF_FFFF




  def  _UpperCAmelCase  (  self			)      ->			str:
     UpperCamelCase_						=  B'\x80' + B'\x00' * (63 - (len(self.data			) + 8) % 64)
     UpperCamelCase_						=  self.data + padding + struct.pack('>Q'		,		8 * len(self.data			)			)
     return padded_data




  def  _UpperCAmelCase  (  self			)      ->			Optional[int]:
     return [
         self.padded_data[i : i + 64] for i in range(0		,		len(self.padded_data			)		,		64			)
     ]




  def  _UpperCAmelCase  (  self		,		_UpperCAmelCase			)      ->			Optional[int]:
     UpperCamelCase_						=  list(struct.unpack('>16L'		,		_UpperCAmelCase			)			) + [0] * 64
     for i in range(16		,		80			):
        UpperCamelCase_						=  self.rotate((w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16])		,		1			)
     return w




  def  _UpperCAmelCase  (  self			)      ->			Any:
     UpperCamelCase_						=  self.padding()
     UpperCamelCase_						=  self.split_blocks()
     for block in self.blocks:
        UpperCamelCase_						=  self.expand_block(_UpperCAmelCase			)
        UpperCamelCase_		,   UpperCamelCase_		,   UpperCamelCase_		,   UpperCamelCase_		,   UpperCamelCase_						=  self.h
        for i in range(0		,		80			):
           if 0 <= i < 20:
              UpperCamelCase_						=  (b & c) | ((~b) & d)
              UpperCamelCase_						=  0x5A82_7999
           elif 20 <= i < 40:
              UpperCamelCase_						=  b ^ c ^ d
              UpperCamelCase_						=  0x6ED9_EBA1
           elif 40 <= i < 60:
              UpperCamelCase_						=  (b & c) | (b & d) | (c & d)
              UpperCamelCase_						=  0x8F1B_BCDC
           elif 60 <= i < 80:
              UpperCamelCase_						=  b ^ c ^ d
              UpperCamelCase_						=  0xCA62_C1D6
           UpperCamelCase_		,   UpperCamelCase_		,   UpperCamelCase_		,   UpperCamelCase_		,   UpperCamelCase_						=  (
               self.rotate(_UpperCAmelCase		,		5			) + f + e + k + expanded_block[i] & 0xFFFF_FFFF,
               a,
               self.rotate(_UpperCAmelCase		,		30			),
               c,
               d,
           )
        UpperCamelCase_						=  (
            self.h[0] + a & 0xFFFF_FFFF,
            self.h[1] + b & 0xFFFF_FFFF,
            self.h[2] + c & 0xFFFF_FFFF,
            self.h[3] + d & 0xFFFF_FFFF,
            self.h[4] + e & 0xFFFF_FFFF,
        )
     return ("{:08x}" * 5).format(*self.h			)






def      _snake_case     ():
   UpperCamelCase_						=  B'Test String'
   assert SHAaHash(__lowercase).final_hash() == hashlib.shaa(__lowercase).hexdigest()  # noqa: S324






def      _snake_case     ():
   UpperCamelCase_						=  argparse.ArgumentParser(description='Process some strings or files')
   parser.add_argument(
       '--string'     ,   dest='input_string'     ,   default='Hello World!! Welcome to Cryptography'     ,   help='Hash the string'     ,   )
   parser.add_argument('--file'     ,   dest='input_file'     ,   help='Hash contents of a file')
   UpperCamelCase_						=  parser.parse_args()
   UpperCamelCase_						=  args.input_string
   # In any case hash input should be a bytestring
   if args.input_file:
      with open(args.input_file     ,   'rb') as f:
         UpperCamelCase_						=  f.read()
   else:
      UpperCamelCase_						=  bytes(__lowercase     ,   'utf-8')
   print(SHAaHash(__lowercase).final_hash())


if __name__ == "__main__":
 main()
 import doctest

 doctest.testmod()








'''simple docstring'''




def    lowerCamelCase__		(    SCREAMING_SNAKE_CASE   : List[Any]							, SCREAMING_SNAKE_CASE   : Union[str, Any]    ):
  # "extended trapezoidal rule"
  # int(f) = dx/2 * (f1 + 2f2 + ... + fn)
  UpperCAmelCase    				=						(boundary[1] - boundary[0]) / steps
  UpperCAmelCase    				=						boundary[0]
  UpperCAmelCase    				=						boundary[1]
  UpperCAmelCase    				=						make_points(SCREAMING_SNAKE_CASE							, SCREAMING_SNAKE_CASE							, SCREAMING_SNAKE_CASE    )
  UpperCAmelCase    				=						0.0
  y += (h / 2.0) * f(SCREAMING_SNAKE_CASE    )
  for i in x_i:
    # print(i)
    y += h * f(SCREAMING_SNAKE_CASE    )
  y += (h / 2.0) * f(SCREAMING_SNAKE_CASE    )
  return y


def    lowerCamelCase__		(    SCREAMING_SNAKE_CASE   : Tuple							, SCREAMING_SNAKE_CASE   : Dict							, SCREAMING_SNAKE_CASE   : Tuple    ):
  UpperCAmelCase    				=						a + h
  while x < (b - h):
    yield x
    UpperCAmelCase    				=						x + h


def    lowerCamelCase__		(    SCREAMING_SNAKE_CASE   : Optional[Any]    ):  # enter your function here
  UpperCAmelCase    				=						(x - 0) * (x - 0)
  return y


def    lowerCamelCase__		(    ):
  UpperCAmelCase    				=						0.0  # Lower bound of integration
  UpperCAmelCase    				=						1.0  # Upper bound of integration
  UpperCAmelCase    				=						10.0  # define number of steps or resolution
  UpperCAmelCase    				=						[a, b]  # define boundary of integration
  UpperCAmelCase    				=						method_a(SCREAMING_SNAKE_CASE							, SCREAMING_SNAKE_CASE    )
  print(f'''y = {y}'''    )


if __name__ == "__main__":
  main()


