Documentation ¶
Overview ¶
Package hashio provides hash-verified I/O streams.
The I/O stream format is defined as follows.
/-----------------------------------------\ | payload | +-----------------------------------------+ | hash | +-----------------------------------------+ | payload | +-----------------------------------------+ | hash | +-----------------------------------------+ | ...... | \-----------------------------------------/
Payload bytes written to / read from the stream are automatically split into segments, each followed by a hash. All data read out must have already passed hash verification. Hence the client code can safely do any kind of (stream) processing of these data.
Index ¶
Constants ¶
const SegmentSize = 8 * 1024
SegmentSize is the unit we split payload data and insert hash at.
Variables ¶
var ErrHashMismatch = errors.New("hash mismatch")
ErrHashMismatch is returned if the ErrHashMismatch does not match.
Functions ¶
Types ¶
This section is empty.