naveen
naveen

Reputation: 29

i am getting some 0 when i am using md5 hash fuction in datafusion wrangler

When i am using the md5 hash fuction like this in wrangler

set-column :numbertohash "12345"

hash :numbertohash MD5 true

i am getting the output like this its 32 0's are appended at start

expected md5 for 12345 is :: 827ccb0eea8a706c4c34a16891f84e7b

i am getting md5 like this :: 00000000000000000000000000000000827ccb0eea8a706c4c34a16891f84e7b

enter image description here

please let me know if any one have idea why i am getting those 0 (zero's) at start.

Upvotes: -2

Views: 73

Answers (2)

vanathi-g
vanathi-g

Reputation: 36

If 'encode' option is set to true, the hashed digest is encoded as hex with left-padding zeroes. See documentation here.

Upvotes: 1

Poala Astrid
Poala Astrid

Reputation: 842

The 32 zeroes cannot be reversed into string, therefore the zeroes can be ignored. It might be a possible bug, and you can file it in the Public Issue Tracker. 

Upvotes: 0

Related Questions