code: def uhash(self, val):
          
  
          if not isinstance(val, string_types):
              raise _TypeError("val", "str", val)
  
          return codecs.encode(self.hash(val.encode("utf-8")), "hex_codec").decode("utf-8")
docs: Calculate hash from unicode value and return hex value as unicode