0

I need to encrypt some data using hashlib encryption in Jython. The output of variable "output" is a set of junk characters "¦?ìîçoÅ"w2?¨?¼?6"

m=hashlib.md5()

m.update(unicode(input).encode('utf-8'))

output = m.digest()

grinder.logger.info(digest= " + str(output))

How can I get the output as an array for the above code.

viji1188
  • 1
  • 3

1 Answers1

0

digest() method return bytes that can be used for other function that require bytes (for example to base64 or compress it). For simply displaying MD5 result as hex use hexdigest() method:

output = m.digest()
hexoutput = m.hexdigest()
print("digest= " + str(hexoutput))
Michał Niklas
  • 53,067
  • 18
  • 70
  • 114