



'''simple docstring'''






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

class 							a__:







    def __init__(				self			:  Optional[int]						,      __snake_case			:  str     ):
      a						: Union[str, Any]					       =					data
      a						: Optional[Any]					       =					[0x67_45_23_01, 0xEF_CD_AB_89, 0x98_BA_DC_FE, 0x10_32_54_76, 0xC3_D2_E1_F0]







    @staticmethod
    def       lowercase_	(				__snake_case			:  List[Any]						,      __snake_case			:  Optional[Any]     ):
      return ((n << b) | (n >> (32 - b))) & 0xFF_FF_FF_FF







    def       lowercase_	(				self			:  Union[str, Any]     ):
      a						: Optional[int]					       =					b'\x80' + b'\x00' * (63 - (len(self.data     ) + 8) % 64)
      a						: List[str]					       =					self.data + padding + struct.pack('>Q'						,      8 * len(self.data     )     )
      return padded_data







    def       lowercase_	(				self			:  Any     ):
      return [
          self.padded_data[i : i + 64] for i in range(0						,      len(self.padded_data     )						,      64     )
      ]







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







    def       lowercase_	(				self			:  Optional[int]     ):
      a						: str					       =					self.padding()
      a						: Dict					       =					self.split_blocks()
      for block in self.blocks:
        a						: str					       =					self.expand_block(__snake_case     )
        a						: Union[str, Any]					       =					self.h
        for i in range(0						,      80     ):
          if 0 <= i < 20:
            a						: Optional[Any]					       =					(b & c) | ((~b) & d)
            a						: Optional[int]					       =					0x5A_82_79_99
          elif 20 <= i < 40:
            a						: Union[str, Any]					       =					b ^ c ^ d
            a						: Tuple					       =					0x6E_D9_EB_A1
          elif 40 <= i < 60:
            a						: Tuple					       =					(b & c) | (b & d) | (c & d)
            a						: Optional[Any]					       =					0x8F_1B_BC_DC
          elif 60 <= i < 80:
            a						: List[Any]					       =					b ^ c ^ d
            a						: Tuple					       =					0xCA_62_C1_D6
          a						: Tuple					       =					(
              self.rotate(__snake_case						,      5     ) + f + e + k + expanded_block[i] & 0xFF_FF_FF_FF,
              a,
              self.rotate(__snake_case						,      30     ),
              c,
              d,
          )
        a						: Tuple					       =					(
            self.h[0] + a & 0xFF_FF_FF_FF,
            self.h[1] + b & 0xFF_FF_FF_FF,
            self.h[2] + c & 0xFF_FF_FF_FF,
            self.h[3] + d & 0xFF_FF_FF_FF,
            self.h[4] + e & 0xFF_FF_FF_FF,
        )
      return ("{:08x}" * 5).format(*self.h     )
def 				lowerCamelCase__	(						):
  a						: Optional[int]					       =					B'Test String'
  assert SHAaHash(_A    ).final_hash() == hashlib.shaa(_A    ).hexdigest()  # noqa: S324
def 				lowerCamelCase__	(						):
  a						: 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'    )
  a						: Tuple					       =					parser.parse_args()
  a						: 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:
      a						: Optional[Any]					       =					f.read()
  else:
    a						: str					       =					bytes(_A			,      'utf-8'    )
  print(SHAaHash(_A    ).final_hash()    )


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

   doctest.testmod()




'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


lowerCAmelCase: List[Any]							=						{}

try:
     if not is_sentencepiece_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCAmelCase: Optional[int]							=						['NllbTokenizer']

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCAmelCase: Dict							=						['NllbTokenizerFast']


if TYPE_CHECKING:
     try:
          if not is_sentencepiece_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_nllb import NllbTokenizer

     try:
          if not is_tokenizers_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_nllb_fast import NllbTokenizerFast

else:
     import sys

     lowerCAmelCase: Tuple							=						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)