





"""simple docstring"""


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






class 							lowercase__			:

			"""simple docstring"""







			def __init__(      self						,   _A    ):






									'''simple docstring'''







									UpperCamelCase				:		Any				   =			data
									UpperCamelCase				:		Any				   =			[0x67_452_301, 0xEF_CDA_B89, 0x98_BAD_CFE, 0x10_325_476, 0xC3_D2E_1F0]







			@staticmethod
			def   _a      (      _A						,   _A    ):






									'''simple docstring'''







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







			def   _a      (      self    ):






									'''simple docstring'''







									UpperCamelCase				:		str				   =			b"""\x80""" + b"""\x00""" * (6_3 - (len(self.data    ) + 8) % 6_4)
									UpperCamelCase				:		int				   =			self.data + padding + struct.pack(""">Q"""						,   8 * len(self.data    )    )
									return padded_data







			def   _a      (      self    ):






									'''simple docstring'''







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







			def   _a      (      self						,   _A    ):






									'''simple docstring'''







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







			def   _a      (      self    ):






									'''simple docstring'''







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


def      UpperCamelCase							():
						UpperCamelCase				:		List[str]				   =			b"""Test String"""
						assert SHAaHash(SCREAMING_SNAKE_CASE     ).final_hash() == hashlib.shaa(SCREAMING_SNAKE_CASE     ).hexdigest()  # noqa: S324

def      UpperCamelCase							():
						UpperCamelCase				:		int				   =			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				:		List[str]				   =			parser.parse_args()
						UpperCamelCase				:		Union[str, Any]				   =			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				:		str				   =			f.read()
						else:
												UpperCamelCase				:		Optional[Any]				   =			bytes(SCREAMING_SNAKE_CASE							,     """utf-8"""     )
						print(SHAaHash(SCREAMING_SNAKE_CASE     ).final_hash()     )


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

		doctest.testmod()










"""simple docstring"""


from math import ceil, sqrt

def      UpperCamelCase							(SCREAMING_SNAKE_CASE = 100_0000     ):
						UpperCamelCase				:		int				   =			0

						for outer_width in range(3							,     (limit // 4) + 2     ):
												if outer_width**2 > limit:
																		UpperCamelCase				:		Optional[Any]				   =			max(ceil(sqrt(outer_width**2 - limit     )     )							,     1     )
												else:
																		UpperCamelCase				:		str				   =			1
												if (outer_width - hole_width_lower_bound) % 2:
																		hole_width_lower_bound += 1

												answer += (outer_width - hole_width_lower_bound - 2) // 2 + 1

						return answer


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



