ns_mhash 1.1
The module implements interface to mhash library (http://mhash.sourceforge.net) for aolserver and standard TCL language.
The module was tested with 0.9.4 version of mhash library.
For TCL samples see test.tcl files into docs directories.
ns_mhash has three categories of commands:
Small samples:
[ns_mhash keygen create MCRYPT "Hello world" [list MD5] 10]
result: <%=[ns_mhash keygen create MCRYPT "Hello world" [list MD5] 10]%>
set td [ns_mhash hash new MD5]
ns_mhash hash update $td "Hello world"
set hash [ns_mhash hash end $td]
ns_adp_puts $hash
result: <%
set td [ns_mhash hash new MD5]
ns_mhash hash update $td "Hello world"
set hash [ns_mhash hash end $td]
ns_adp_puts $hash
%>
set td [ns_mhash hmac new MD5 "password"]
ns_mhash hmac update $td "Hello world"
set hmac [ns_mhash hmac end -base64 $td]
ns_adp_puts $hmac
result: <%
set td [ns_mhash hmac new MD5 "password"]
ns_mhash hmac update $td "Hello world"
set hmac [ns_mhash hmac end -base64 $td]
ns_adp_puts $hmac
%>