Documentation
¶
Index ¶
- Constants
- func ByteCountDecimal(b int64) string
- func ChunkRangesToChunks(chunkRanges []int64) (chunks []int64)
- func Exists(name string) bool
- func FindOpenPorts(host string, portNumStart, numPorts int) (openPorts []int)
- func GenerateRandomPin() string
- func GetConfigDir(requireValidPath bool) (homedir string, err error)
- func GetInput(prompt string) string
- func GetLocalIPs() (ips []string, err error)
- func GetRandomName() string
- func HashFile(fname string, algorithm string) (hash256 []byte, err error)
- func IMOHashFile(fname string) (hash []byte, err error)
- func IMOHashFileFull(fname string) (hash []byte, err error)
- func IsLocalIP(ipaddress string) bool
- func LocalIP() string
- func MD5HashFile(fname string) (hash256 []byte, err error)
- func MissingChunks(fname string, fsize int64, chunkSize int) (chunkRanges []int64)
- func PublicIP() (ip string, err error)
- func RandomFileName() (fname string, err error)
- func SHA256(s string) string
- func UnzipDirectory(destination string, source string) error
- func ValidFileName(fname string) bool
- func XXHashFile(fname string) (hash256 []byte, err error)
- func ZipDirectory(destination string, source string) (err error)
Constants ¶
const NbBytesWords = 4
const NbPinNumbers = 4
Variables ¶
This section is empty.
Functions ¶
func ByteCountDecimal ¶
ByteCountDecimal converts bytes to human readable byte string
func ChunkRangesToChunks ¶
ChunkRangesToChunks converts chunk ranges to list
func FindOpenPorts ¶
func GenerateRandomPin ¶
func GenerateRandomPin() string
func GetConfigDir ¶
Get or create home directory
func HashFile ¶
HashFile returns the hash of a file or, in case of a symlink, the SHA256 hash of its target. Takes an argument to specify the algorithm to use.
func IMOHashFile ¶
IMOHashFile returns imohash
func IMOHashFileFull ¶
IMOHashFileFull returns imohash of full file
func MD5HashFile ¶
MD5HashFile returns MD5 hash
func MissingChunks ¶
MissingChunks returns the positions of missing chunks. If file doesn't exist, it returns an empty chunk list (all chunks). If the file size is not the same as requested, it returns an empty chunk list (all chunks).
func RandomFileName ¶
func UnzipDirectory ¶
func ValidFileName ¶
ValidFileName checks if a filename is valid and returns true only if it all of the characters are either 0-9, a-z, A-Z, ., _, -, space, or /
func XXHashFile ¶
XXHashFile returns the xxhash of a file
func ZipDirectory ¶
Types ¶
This section is empty.