Documentation ¶
Overview ¶
Simple crypto utilities.
Simple file utilities.
Some helper functions used in various parts of the system.
Simple networking utilities. IsPrivateIP nabbed from https://stackoverflow.com/questions/41240761/go-check-if-ip-address-is-in-private-network-space, thanks Doug Nukem and Brad Peabody.
Index ¶
- func ByteArrayComparator(a, b []byte) bool
- func ByteArrayContains(array [][]byte, lookFor []byte) bool
- func ByteArrayCopy(source []byte, length int) []byte
- func CopyFile(src, dst string) error
- func DoubleSha256(input []byte) [32]byte
- func DownloadFile(source, destination string) error
- func FileDoesNotExists(file string) bool
- func IsPrivateIP(ip net.IP) bool
- func StringToFile(s string, file string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteArrayComparator ¶
Compares two byte arrays for sorting purposes. Return: true if a should come first in ascending order, false otherwise.
func ByteArrayContains ¶
Returns true if the given array of byte arrays contains lookFor
func ByteArrayCopy ¶
Make a clean copy of the <source> byte array with the given length to reduce memory footprint.
func DoubleSha256 ¶
func DownloadFile ¶
Download a file via http(s) and store it locally.
func FileDoesNotExists ¶
FileDoesNotExists returns 'true' if we can safely assume that the given file does not exist.
func IsPrivateIP ¶
func StringToFile ¶
Helper to create a file and write the given text to it. If the file exists, it will be overwritten.
Types ¶
This section is empty.