file-storage-torrent-procs.tcl

Location:
packages/file-storage/tcl/file-storage-torrent-procs.tcl
Created:
2005-10-25
Author:
Al-Faisal El-Dajani <faisal.dajani@gmail.com>

Procedures in this file

Detailed information

fs::torrent::get_hashsum (public, deprecated)

 fs::torrent::get_hashsum -filename filename
Deprecated. Invoking this procedure generates a warning.

Get hashsum for the file using SHA1 hashsum technique. DEPRECATED: NaviServer can now perform such a digest in a oneliner that won't require slurping the file first.

Switches:
-filename (required)
Name of file to get hashsum for. Must be in absolute path format.
Returns:
Hashsum of file in hexa.
Author:
Al-Faisal El-Dajani <faisal.dajani@gmail.com>
Created:
2005-10-25
See Also:
  • ns_md

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) fs::torrent::get_hashsum fs::torrent::get_hashsum fs::torrent::get_hashsum->ad_log_deprecated

Testcases:
No testcase defined.
[ hide source ] | [ make this the default ]

Content File Source

ad_library {
    @author Al-Faisal El-Dajani (faisal.dajani@gmail.com)
    @creation-date 2005-10-25
}

namespace eval fs::torrent {}

d_proc -deprecated fs::torrent::get_hashsum {
    {-filename:required}
} {
    Get hashsum for the file using SHA1 hashsum technique.

    DEPRECATED: NaviServer can now perform such a digest in a oneliner
    that won't require slurping the file first.

    @see ns_md

    @author Al-Faisal El-Dajani (faisal.dajani@gmail.com)
    @creation-date 2005-10-25
    @param filename Name of file to get hashsum for. Must be in absolute path format.
    @return Hashsum of file in hexa.
} {
    set file_stream [open $filename r]
    set file_contents [read $file_stream]
    close $file_stream
    return [ns_sha1 $file_contents]
}
# Local variables:
#    mode: tcl
#    tcl-indent-level: 4
#    indent-tabs-mode: nil
# End: