

"""simple docstring"""





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


class      _lowercase :


      def __init__(    self				:	Optional[Any]							,   a				:	List[str]						):





            """simple docstring"""







            __snake_case      :    Any  			=data
            __snake_case      :    Dict  			=[0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]


      @staticmethod
      def _UpperCamelCase						(    a				:	Optional[int]							,   a				:	List[Any]						):





            """simple docstring"""







            return ((n << b) | (n >> (3_2 - b))) & 0xFFFFFFFF


      def _UpperCamelCase						(    self				:	Any						):





            """simple docstring"""







            __snake_case      :    Tuple  			=b'''\x80''' + b'''\x00''' * (6_3 - (len(self.data						) + 8) % 6_4)
            __snake_case      :    Any  			=self.data + padding + struct.pack('''>Q'''							,   8 * len(self.data						)						)
            return padded_data


      def _UpperCamelCase						(    self				:	Union[str, Any]						):





            """simple docstring"""







            return [
                self.padded_data[i : i + 6_4] for i in range(0							,   len(self.padded_data						)							,   6_4						)
            ]


      def _UpperCamelCase						(    self				:	Union[str, Any]							,   a				:	str						):





            """simple docstring"""







            __snake_case      :    Any  			=list(struct.unpack('''>16L'''							,   _A						)						) + [0] * 6_4
            for i in range(1_6							,   8_0						):
                  __snake_case      :    Any  			=self.rotate((w[i - 3] ^ w[i - 8] ^ w[i - 1_4] ^ w[i - 1_6])							,   1						)
            return w







      def _UpperCamelCase						(    self				:	Tuple						):





            """simple docstring"""







            __snake_case      :    Any  			=self.padding()
            __snake_case      :    Any  			=self.split_blocks()
            for block in self.blocks:
                  __snake_case      :    str  			=self.expand_block(_A						)
                  __snake_case			,				__snake_case			,				__snake_case			,				__snake_case			,				__snake_case      :    List[Any]  			=self.h
                  for i in range(0							,   8_0						):
                        if 0 <= i < 2_0:
                              __snake_case      :    List[str]  			=(b & c) | ((~b) & d)
                              __snake_case      :    Tuple  			=0x5A827999
                        elif 2_0 <= i < 4_0:
                              __snake_case      :    str  			=b ^ c ^ d
                              __snake_case      :    Dict  			=0x6ED9EBA1
                        elif 4_0 <= i < 6_0:
                              __snake_case      :    int  			=(b & c) | (b & d) | (c & d)
                              __snake_case      :    List[str]  			=0x8F1BBCDC
                        elif 6_0 <= i < 8_0:
                              __snake_case      :    int  			=b ^ c ^ d
                              __snake_case      :    Optional[Any]  			=0xCA62C1D6
                        __snake_case			,				__snake_case			,				__snake_case			,				__snake_case			,				__snake_case      :    Dict  			=(
                            self.rotate(_A							,   5						) + f + e + k + expanded_block[i] & 0xFFFFFFFF,
                            a,
                            self.rotate(_A							,   3_0						),
                            c,
                            d,
                        )
                  __snake_case      :    List[Any]  			=(
                      self.h[0] + a & 0xFFFFFFFF,
                      self.h[1] + b & 0xFFFFFFFF,
                      self.h[2] + c & 0xFFFFFFFF,
                      self.h[3] + d & 0xFFFFFFFF,
                      self.h[4] + e & 0xFFFFFFFF,
                  )
            return ("{:08x}" * 5).format(*self.h						)



def     __lowercase					(    )					->					Any:
      __snake_case      :    Union[str, Any]  			=B'''Test String'''
      assert SHAaHash(UpperCAmelCase__ ).final_hash() == hashlib.shaa(UpperCAmelCase__ ).hexdigest()  # noqa: S324



def     __lowercase					(    )					->					Optional[int]:
      __snake_case      :    str  			=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''' )
      __snake_case      :    Union[str, Any]  			=parser.parse_args()
      __snake_case      :    List[str]  			=args.input_string
      # In any case hash input should be a bytestring
      if args.input_file:
            with open(args.input_file       ,		'''rb''' ) as f:
                  __snake_case      :    Any  			=f.read()
      else:
            __snake_case      :    Optional[Any]  			=bytes(UpperCAmelCase__       ,		'''utf-8''' )
      print(SHAaHash(UpperCAmelCase__ ).final_hash() )


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

    doctest.testmod()










"""simple docstring"""





def     __lowercase					(    a :				int       ,		a :				int )					->					int:
      return x if y == 0 else greatest_common_divisor(a       ,		x % y )



def     __lowercase					(    a :				int       ,		a :				int )					->					int:
      return (x * y) // greatest_common_divisor(a       ,		a )



def     __lowercase					(    a :				int = 20 )					->					int:
      __snake_case      :    Optional[Any]  			=1
      for i in range(1       ,		n + 1 ):
            __snake_case      :    Optional[int]  			=lcm(a       ,		a )
      return g


if __name__ == "__main__":
    print(F'''{solution() = }''')


