[−][src]Trait phollaits::HashExt
This trait implements several hash-algorithms for any type which implements the io::Read-Trait.
Required methods
pub fn md5sum(&mut self) -> Result<String>
[src]
this method returns the md5-digest for implemented types as a std::io::Result of String.
Example
extern crate phollaits; use phollaits::HashExt; use std::fs; use std::io; fn main() -> io::Result<()> { let file = fs::File::open("/home/ph0llux/Pictures/image01.png")?; println!("{:?}", file.md5sum()); Ok(()) }
pub fn sha1sum(&mut self) -> Result<String>
[src]
this method returns the sha1-digest for implemented types as a std::io::Result of String.
Example
extern crate phollaits; use phollaits::HashExt; use std::fs; use std::io; fn main() -> io::Result<()> { let file = fs::File::open("/home/ph0llux/Pictures/image01.png")?; println!("{:?}", file.sha1sum()); Ok(()) }
pub fn sha256sum(&mut self) -> Result<String>
[src]
this method returns the sha256-digest for implemented types as a std::io::Result of String.
Example
extern crate phollaits; use phollaits::HashExt; use std::fs; use std::io; fn main() -> io::Result<()> { let file = fs::File::open("/home/ph0llux/Pictures/image01.png")?; println!("{:?}", file.sha256sum()); Ok(()) }
pub fn sha384sum(&mut self) -> Result<String>
[src]
this method returns the sha384-digest for implemented types as a std::io::Result of String.
Example
extern crate phollaits; use phollaits::HashExt; use std::fs; use std::io; fn main() -> io::Result<()> { let file = fs::File::open("/home/ph0llux/Pictures/image01.png")?; println!("{:?}", file.sha384sum()); Ok(()) }
pub fn sha512sum(&mut self) -> Result<String>
[src]
this method returns the sha512-digest for implemented types as a std::io::Result of String.
Example
extern crate phollaits; use phollaits::HashExt; use std::fs; use std::io; fn main() -> io::Result<()> { let file = fs::File::open("/home/ph0llux/Pictures/image01.png")?; println!("{:?}", file.sha512sum()); Ok(()) }