Documentation ¶
Index ¶
- func CompressAndEncryptBytesToFile(inputBytes []byte, outputFilename string, password string) (err error)
- func CompressByte(src []byte) []byte
- func CopyFile(src, dst string) (err error)
- func CryptReaderToWriter(src io.Reader, dst io.Writer, password string, encrypt bool) (err error)
- func DecompressByte(src []byte) []byte
- func Decrypt(data []byte, passphrase []byte) (plaintext []byte, err error)
- func DecryptAndDecompressBytesFromFile(inputFilename string, password string) (output []byte, err error)
- func DecryptBytesFromFile(inputFilename string, password string) (output []byte, err error)
- func DecryptFile(inputFilename string, outputFilename string, password string) error
- func Dos2Unix(b []byte) []byte
- func Encrypt(plaintext []byte, passphrase []byte) (encrypted []byte)
- func EncryptBytesToFile(inputBytes []byte, outputFilename string, password string) (err error)
- func EncryptFile(inputFilename string, outputFilename string, password string) error
- func Exists(path string) bool
- func Filemd5Sum(pathToFile string) (result string, err error)
- func GetLocalIP() string
- func GetRandomName() string
- func Hash(data string) string
- func HashBytes(data []byte) string
- func Md5Sum(s string) (result string)
- func RandStringBytesMaskImprSrc(n int) string
- func UserHomeDir() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressAndEncryptBytesToFile ¶
func CompressAndEncryptBytesToFile(inputBytes []byte, outputFilename string, password string) (err error)
CompressAndEncryptBytesToFile will compress and then encrypt files to bytes.
func CompressByte ¶
CompressByte returns a compressed byte slice.
func CopyFile ¶
CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Copy the file contents from src to dst. from http://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang
func CryptReaderToWriter ¶
CryptReaderToWriter will take inputbytes and output them to a file
func DecompressByte ¶
DecompressByte returns a decompressed byte slice.
func DecryptAndDecompressBytesFromFile ¶
func DecryptAndDecompressBytesFromFile(inputFilename string, password string) (output []byte, err error)
DecryptAndDecompressBytesFromFile will take a file and decrypt them.
func DecryptBytesFromFile ¶
DecryptBytesFromFile will take a file and decrypt them into bytes.
func DecryptFile ¶
func EncryptBytesToFile ¶
EncryptBytesToFile will take inputbytes and output them to a file
func EncryptFile ¶
func Exists ¶
Exists returns whether the given file or directory exists or not from http://stackoverflow.com/questions/10510691/how-to-check-whether-a-file-or-directory-denoted-by-a-path-exists-in-golang
func Filemd5Sum ¶
Filemd5Sum returns the md5 sum of a file and produces the same hash for both Windows and Unix systems.
func RandStringBytesMaskImprSrc ¶
RandStringBytesMaskImprSrc prints a random string
func UserHomeDir ¶
func UserHomeDir() string
UserHomeDir returns the user home directory taken from go1.8c2 https://stackoverflow.com/a/41786440
Types ¶
This section is empty.