Documentation ¶
Index ¶
- Constants
- func AppendChecksum(in []byte) []byte
- func BytesToUint64(bytes []byte) uint64
- func PadData(data []byte, required, total int) []byte
- func Split(data []byte, required, total int) [][]byte
- func Uint64ToBytes(input uint64) []byte
- func UnpadData(data []byte) (out []byte)
- func VerifyChecksum(in []byte) (out []byte, verified bool)
- func ZeroBytes(b []byte)
- type RS
Constants ¶
View Source
const ( ShardsTotal = 9 ShardsRequired = 3 )
Variables ¶
This section is empty.
Functions ¶
func AppendChecksum ¶
func BytesToUint64 ¶
BytesToUint64 - converts 4 byte slice to uint32
func PadData ¶
padData appends a 2 byte length prefix, and pads to a multiple of total. Note that the 16 bit prefix limits max chunk size to 64kb, thus creating a max of 64kb * number of required shares. If the data length is greater than this, the function returns an nil slice to indicate error
func Uint64ToBytes ¶
Uint64ToBytes - returns a byte slice from uint64 - required because Murmur3 takes bytes as input but returns uint32
func UnpadData ¶
UnpadData reverses the padding applied in PadData by reading the length prefix and slicing off the extra bytes
func VerifyChecksum ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.