code: def hash_input(inpt, algo=HASH_SHA256):
      
      if (algo == HASH_MD5):
          hashcode = hashlib.md5()
      elif (algo == HASH_SHA1):
          hashcode = hashlib.sha1()
      elif (algo == HASH_SHA224):
          hashcode = hashlib.sha224()
      elif (algo == HASH_SHA256):
          hashcode = hashlib.sha256()
      elif (algo == HASH_SHA384):
          hashcode = hashlib.sha384()
      elif (algo == HASH_SHA512):
          hashcode = hashlib.sha512()
  
      if sys.version_info.major == 2:
          inpt = bytes(inpt)
      else:
          inpt = bytes(inpt, "utf-8")
  
      hashcode.update(inpt)
      hexhash = hashcode.hexdigest()
      return hexhash
docs: Generates a hash from a given String
      with a specified algorithm and returns the
      hash in hexadecimal form. Default: sha256.