struct SleepParser::Header

Defined in:

sleep_parser/header.cr

Constant Summary

ALGORITHM_MAX_LENGTH = HEADER_LENGTH - 8
HEADER_LENGTH = 32
INDICATOR = Slice[5_u8, 2_u8, 87_u8]

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(file_type : SleepParser::FileType, entry_size : UInt16, hash_type : SleepParser::HashType, protocol_version : SleepParser::ProtocolVersion = ProtocolVersion::V0) #

[View source]

Class Method Detail

def self.from_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::NetworkEndian) #

[View source]

Instance Method Detail

def entry_size : UInt16 #

Size of each piece of data in the file body.


[View source]
def file_type : FileType #

Type of file.


[View source]
def hash_type : HashType #

Algorithm used for hashing the content.


[View source]
def protocol_version : ProtocolVersion #

Version of the SLEEP protocol.


[View source]
def to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::NetworkEndian) #

[View source]
def valid? : Bool #

[View source]