Documentation
¶
Index ¶
- 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 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 XXHashFile(fname string) (hash256 []byte, err error)
Constants ¶
This section is empty.
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 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 ¶ added in v9.1.1
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 XXHashFile ¶
XXHashFile returns the xxhash of a file
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.