[][src]Crate sleep_parser

Example

extern crate sleep_parser as sleep_parser;

use sleep_parser::{FileType, HashType, Header};
use std::fs::File;
use std::io::{BufRead, BufReader};

let file = File::open("tests/fixtures/content.bitfield").unwrap();
let mut reader = BufReader::with_capacity(32, file);
let buffer = reader.fill_buf().unwrap();
let header = Header::from_vec(&buffer).unwrap();
assert!(header.is_bitfield());

Structs

Header

Structural representation of 32 byte SLEEP headers.

Enums

FileType

Type of file.

HashType

Algorithm used for hashing the data.

ProtocolVersion

SLEEP Protocol version.

Functions

create_bitfield

Create a new Header in the Bitfield configuration.

create_signatures

Create a new Header in the Signatures configuration.

create_tree

Create a new Header in the Tree configuration.