chunks

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ChunkHeaderMagic = 0xB1FE3AA2
)

Variables

This section is empty.

Functions

func ParseChunk

func ParseChunk(reader io.ReadSeeker) (io.ReadSeeker, error)

Types

type ChunkHeader

type ChunkHeader struct {
	Magic              uint32 // 0xB1FE3AA2
	Version            uint32
	HeaderSize         uint32
	DataSizeCompressed uint32
	GUID               uuid.UUID
	RollingHash        uint64
	StoredAs           ChunkStoredAs
	SHAHash            [20]byte
	HashType           uint32
}

ChunkHeader defines the binary chunk header

func ParseChunkHeader

func ParseChunkHeader(r io.ReadSeeker) (*ChunkHeader, error)

type ChunkStoredAs

type ChunkStoredAs uint8
const (
	ChunkStoredAsPlaintext  ChunkStoredAs = 0x00
	ChunkStoredAsCompressed ChunkStoredAs = 0x01
	ChunkStoredAsEncrypted  ChunkStoredAs = 0x02
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL