diff options
author | zyp <zyp@localhost> | 2006-10-19 17:11:00 +0200 |
---|---|---|
committer | zyp <zyp@localhost> | 2006-10-19 17:11:00 +0200 |
commit | f93b71da9bcd01d7c1db797d9a84b95cbdabde0b (patch) | |
tree | dc16b47633ed53653ad7697a5785f05aaf0cb21a /src/hash.cpp | |
parent | 77e467c9bae74863016e028008290e5f6fd1bca3 (diff) |
[project @ zyp-20061019151100-032626b43d2f238b]
[project @ 59]
Added hash_file-function.
Diffstat (limited to 'src/hash.cpp')
-rw-r--r-- | src/hash.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/hash.cpp b/src/hash.cpp index 89b14cc..82df4c0 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -60,4 +60,12 @@ namespace Multihash { std::string Hash::hash_digest() { throw std::runtime_error("Not implemented."); } + + void _hash_file(int fileno, Hash* hash) { + char buf[32768]; + int s; + while((s = read(fileno, buf, 32768)) > 0) { + hash->_update(buf, s); + } + } } |