Loading src/crypto/hash.rs +8 −0 Original line number Diff line number Diff line use libc::c_uint; use std::ptr; use std::io; use ffi; Loading Loading @@ -34,6 +35,13 @@ pub struct Hasher { len: uint, } impl io::Writer for Hasher { fn write(&mut self, buf: &[u8]) -> io::IoResult<()> { self.update(buf); Ok(()) } } impl Hasher { pub fn new(ht: HashType) -> Hasher { ffi::init(); Loading Loading
src/crypto/hash.rs +8 −0 Original line number Diff line number Diff line use libc::c_uint; use std::ptr; use std::io; use ffi; Loading Loading @@ -34,6 +35,13 @@ pub struct Hasher { len: uint, } impl io::Writer for Hasher { fn write(&mut self, buf: &[u8]) -> io::IoResult<()> { self.update(buf); Ok(()) } } impl Hasher { pub fn new(ht: HashType) -> Hasher { ffi::init(); Loading