Forum OpenACS Development: Re: ns_hmac and byte array

Collapse
3: Re: ns_hmac and byte array (response to 2)
Posted by Dave Bauer on
Thanks Gustaf, your example returns the same result as my Python example.

When I run this code on my Naviserver it returns a different result.
I am not sure if this is a result of a different library I have or some Naviserver encoding setting perhaps. Very curious.

set b [binary format H* "abcd1234"]
set h [ns_hmac string -digest SHA512 $b "This is a test"]

b results in the same value «Í4
but h contains a different result
ffc30b14fc4589bcb3fea23a8cd7825adc64cb5072462985d62f93d005b2fc89454614616f3f08a64fa63800217eb963d2bdc6284ff801edc1cd607e9473fa75