Documentation ¶
Index ¶
- func BoolFromByteArray(v []byte) (bool, error)
- func BoolToByteArray(v bool) []byte
- func ConcatByteArrays(arrays ...[]byte) []byte
- func GenerateFileWithTestData(filePath string, data []byte) (*os.File, error)
- func GetFileSize(file *os.File) (uint64, error)
- func GetHash(key []byte, blockLength uint64) uint64
- func PathExists(path string) (bool, error)
- func SafeSlice(data []byte, start uint64, end uint64, maxLength uint64) ([]byte, error)
- func Uint16FromByteArray(v []byte) (uint16, error)
- func Uint16ToByteArray(v uint16) []byte
- func Uint32FromByteArray(v []byte) (uint32, error)
- func Uint32ToByteArray(v uint32) []byte
- func Uint64FromByteArray(v []byte) (uint64, error)
- func Uint64ToByteArray(v uint64) []byte
- func ValidateBounds(actualLower uint64, actualUpper uint64, expectedLower uint64, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolFromByteArray ¶
BoolFromByteArray converts a BigEndian byte array to a bool
func BoolToByteArray ¶
BoolToByteArray converts a bool to a byte array
func ConcatByteArrays ¶
ConcatByteArrays concatenates a number of byte arrays
func GenerateFileWithTestData ¶
GenerateFileWithTestData creates a file at the given filePath if it does not exist and adds the given data overwriting any pre-existing data
func GetFileSize ¶ added in v0.1.0
GetFileSize computes the file size of the given file
func GetHash ¶
GetHash generates the hash of the key for the given block length to get the position in the block that the given key corresponds to
func PathExists ¶ added in v0.1.0
PathExists checks to see if a given path exists
func Uint16FromByteArray ¶
Uint16FromByteArray converts a BigEndian byte array to a uint16
func Uint16ToByteArray ¶
Uint16ToByteArray converts a uint16 to a BigEndian byte array
func Uint32FromByteArray ¶
Uint32FromByteArray converts a BigEndian byte array to a uint32
func Uint32ToByteArray ¶
Uint32ToByteArray converts a uint32 to a BigEndian byte array
func Uint64FromByteArray ¶
Uint64FromByteArray converts a BigEndian byte array to a uint64
func Uint64ToByteArray ¶
Uint64ToByteArray converts a uint64 to a BigEndian byte array
Types ¶
This section is empty.