Class ::ns_md
::ns_md
create ... \
[ -ctx ctx ] \
[ -digest (default "sha256") ]
Defined in Class Relations
- class: ::nx::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- superclass: ::ns_crypto::HashFunctions
![[i]](/resources/acs-subsite/ZoomIn16.gif)
::nx::Class create ::ns_md \
-superclass ::ns_crypto::HashFunctions
Methods (to be applied on the object)
file (scripted, public)
ns_md
file [ -digest digest ] [ -encoding encoding ] filename args \
[ args... ]
- Switches:
- -digest (optional, defaults to
"sha256") - -encoding (optional, defaults to
"hex")
- Parameters:
- filename (required)
- args (required)
- Testcases:
-
No testcase defined.
set m [:new -digest $digest]
set r ""
foreach path [concat [list $filename] $args] {
if {![file readable $path]} {
$m destroy
return -code error "file $path is not readable"
}
set r [$m readfile -encoding $encoding $path]
}
$m destroy
return $rstring (scripted, public)
ns_md
string [ -digest digest ] [ -encoding encoding ] message
- Switches:
- -digest (optional, defaults to
"sha256") - -encoding (optional, defaults to
"hex")
- Parameters:
- message (required)
- Testcases:
-
No testcase defined.
::ns_crypto::md string -digest $digest -encoding $encoding $message
Methods (to be applied on instances)
add (scripted, public)
<instance of ns_md
> add message
- Parameters:
- message (required)
- Testcases:
-
No testcase defined.
::ns_crypto::md add ${:ctx} $messagedestroy (scripted, public)
<instance of ns_md
> destroy
- Testcases:
-
No testcase defined.
if {[info exists :ctx]} {
::ns_crypto::md free ${:ctx}
}
nextget (scripted, public)
<instance of ns_md
> get [ -encoding encoding ]
- Switches:
- -encoding (optional, defaults to
"hex")
- Testcases:
-
No testcase defined.
::ns_crypto::md get -encoding $encoding ${:ctx}