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, showProgress ...bool) (hash256 []byte, err error)
- func HighwayHashFile(fname string, doShowProgress bool) (hashHighway []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, doShowProgress bool) (hash256 []byte, err error)
- func MarkFileForRemoval(fname string)
- func MissingChunks(fname string, fsize int64, chunkSize int) (chunkRanges []int64)
- func PublicIP() (ip string, err error)
- func RandomFileName() (fname string, err error)
- func RemoveMarkedFiles() (err error)
- func SHA256(s string) string
- func UnzipDirectory(destination string, source string) error
- func ValidFileName(fname string) (err error)
- func XXHashFile(fname string, doShowProgress bool) (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
GenerateRandomPin returns a randomly generated pin with set lenght
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 HighwayHashFile ¶ added in v10.0.6
HighwayHashFile returns highwayhash of a file
func IMOHashFile ¶
IMOHashFile returns imohash
func IMOHashFileFull ¶
IMOHashFileFull returns imohash of full file
func MD5HashFile ¶
MD5HashFile returns MD5 hash
func MarkFileForRemoval ¶ added in v10.0.13
func MarkFileForRemoval(fname string)
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 RemoveMarkedFiles ¶ added in v10.0.13
func RemoveMarkedFiles() (err error)
func UnzipDirectory ¶
func ValidFileName ¶
ValidFileName checks if a filename is valid by making sure it has no invisible characters
func XXHashFile ¶
XXHashFile returns the xxhash of a file
func ZipDirectory ¶
Types ¶
This section is empty.