Forum Discussion
sha256 function incorrect output
Hi devcentral, when using the sha256 function to hash a string I am unable to replicate the online sha hash function. For example, if I enter the string "myhash" without the quotes into: http://www.xorbin.com/tools/sha256-hash-calculator I receive: e037f671bf37164c071d526e8960fd9122383d5d73ef3b60f1bc9f330a15c1e1
However when this is done using the sha256 iRule function I get: à 7öq¿7LRnÂ
ýÂ"8=]sï;ñ¼Â3 Ãá
which seems like I have the wrong encoding somewhere?
thanks in advance!!
3 Replies
- mhite_60883
Cirrocumulus
The online tool you are using displays the hex encoding of the hash. The iRule function is raw binary. I am NOT an iRule or TCL guy, but I think you can use this to convert to a hex string:
http://tmml.sourceforge.net/doc/tcl/binary.html
Good luck,
-M
- mhuss3y_61750
Nimbostratus
Thanks M for the tip!
- mhite_60883
Cirrocumulus
No problem -- happy to help!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
