Documentation
¶
Index ¶
- func CreateDir(dir string) (string, error)
- func CreateDirFromFilename(destination string, s string) (string, error)
- func CreateFileWithDir(destination string) (string, error)
- func EncodeFileToBase64(filename string) (string, error)
- func FileExists(path string) bool
- func Float64ToTime(f float64) time.Time
- func FormatInt(n int) string
- func FormatInt64(n int64) string
- func GetDNSServers() (nameservers []netip.AddrPort)
- func GetDefaultDnsServer(fallback string) string
- func GetHash(data []byte) string
- func GetMimeType(s string) (string, error)
- func GetValidDnsSuffix(dnsServer string, suffix string, proxyUri *url.URL) (string, error)
- func HammingDistance(hash1, hash2 []byte) (int, error)
- func HasBOM(fileName string) bool
- func IpToUint32(ip net.IP) uint32
- func IpsInCIDR(cidr string) ([]string, error)
- func IsPrivateIP(ipAddr string) bool
- func LeftTrucate(s string, max int) string
- func MoveFile(sourcePath, destPath string) error
- func ParsePerceptionHash(hashStr string) ([]byte, error)
- func RandSleep()
- func RemoveFolder(path string) error
- func SafeFileName(s string) string
- func ShuffleStr(slice []string)
- func SliceHasInt(slice []int, item int) bool
- func SliceHasStr(slice []string, item string) bool
- func SliceHasUInt16(slice []uint16, item uint16) bool
- func TempFileName(base_path, prefix, suffix string) string
- func UniqueIntSlice(slice []int) []int
- func Unzip(src, dest string) error
- type HammingGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDir ¶
CreateDir creates a directory if it does not exist, returning the final normalized directory as a result.
func CreateDirFromFilename ¶ added in v0.1.8
func CreateFileWithDir ¶
CreateFileWithDir creates a file, relative to a directory, returning the final normalized path as a result.
func EncodeFileToBase64 ¶
func Float64ToTime ¶
Float64ToTime takes a float64 as number of seconds since unix epoch and returns time.Time
example field where this is used (expires field):
https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-Cookie
func FormatInt64 ¶
func GetDNSServers ¶ added in v0.1.10
func GetDefaultDnsServer ¶ added in v0.1.10
func GetMimeType ¶ added in v0.1.8
func GetValidDnsSuffix ¶
func HammingDistance ¶
HammingDistance calculates the number of differing bits between two byte slices.
func IpToUint32 ¶ added in v0.1.17
func IpsInCIDR ¶
IpsInCIDR returns a list of usable IP addresses in a given CIDR block excluding network and broadcast addresses for CIDRs larger than /31.
func IsPrivateIP ¶ added in v0.1.10
func LeftTrucate ¶
LeftTrucate a string if its more than max
func ParsePerceptionHash ¶
ParsePerceptionHash converts a perception hash string "p:<hex>" to a byte slice.
func RemoveFolder ¶ added in v0.1.8
func SafeFileName ¶
SafeFileName takes a string and returns a string safe to use as a file name.
func SliceHasInt ¶
SliceHasInt checks if a slice has an int
func SliceHasStr ¶
SliceHasStr checks if a slice has a string
func SliceHasUInt16 ¶ added in v0.1.9
SliceHasInt checks if a slice has an int
func TempFileName ¶ added in v0.1.8
func UniqueIntSlice ¶
UniqueIntSlice returns a slice of unique ints
Types ¶
type HammingGroup ¶
HammingGroup represents a hash -> group assignment used for inmemory hammingdistance calulations.