utils

package
v6.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCountDecimal

func ByteCountDecimal(b int64) string

func ChunkRangesToChunks

func ChunkRangesToChunks(chunkRanges []int64) (chunks []int64)

func Exists

func Exists(name string) bool

Exists reports whether the named file or directory exists.

func GetInput

func GetInput(prompt string) string

GetInput returns the input with a given prompt

func GetLocalIPs

func GetLocalIPs() (ips []string, err error)

func GetRandomName

func GetRandomName() string

func HashFile

func HashFile(fname string) (hash256 []byte, err error)

HashFile returns the hash of a file

func IMOHashFile

func IMOHashFile(fname string) (hash []byte, err error)

IMOHashFile returns imohash

func LocalIP

func LocalIP() string

Get preferred outbound ip of this machine

func MD5HashFile

func MD5HashFile(fname string) (hash256 []byte, err error)

func MissingChunks

func MissingChunks(fname string, fsize int64, chunkSize int) (chunkRanges []int64)

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 PublicIP

func PublicIP() (ip string, err error)

func SHA256

func SHA256(s string) string

SHA256 returns sha256 sum

func XXHashFile

func XXHashFile(fname string) (hash256 []byte, err error)

XXHashFile returns the xxhash of a file

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL