Documentation ¶
Index ¶
- func Compress(input string, output string) error
- func Decompress(input string, output string) error
- func Decrypt(input string, output string, password string) error
- func Encrypt(input string, output string, password string) error
- func GetCRC32(fileName string) (uint32, error)
- func GetDecompressedSize(fileName string) (uint32, error)
- func GetGzipCRC32(fileName string) (uint32, error)
- func PackFolder(input string, output string) error
- func Unpack(input string, output string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
Compress compress input file into output path. ".gz" extension is added to output.
If output == "" then generated file is saved in current directory.
Example: Compress("folder1/myfile.tar", "") generates "./myfile.tar.gz"
func Decompress ¶
Decompress decompress input file into output path.
If output == "" then uses current directory.
Example: Decompress("projects.gz", "user/projectsfolder")
func Decrypt ¶
Decrypt decrypts input file into output path using the password. This function uses AES256 algorithm (mode GCM).
Input file must have the extension ".crp"
If output == "" then uses current directory.
Example: Decrypt("projects.tar.gz.crp", "") generates "./projects.tar.gz"
func Encrypt ¶
Encrypt encrypts input file into output path using the password. This function uses AES256 algorithm (mode GCM).
Password lenght can be any not zero value. The password is processed by the SHA256 hash algorithm to generate a 256-bit key.
If output == "" then uses current directory.
Example: Encrypt("projects.tar.gz", "") generates "./projects.tar.gz.crp"
func GetDecompressedSize ¶ added in v0.4.0
GetDecompressedSize gets decompresed size of the gzip file.
func GetGzipCRC32 ¶ added in v0.4.0
GetGzipCRC32 gets crc32 checksum of decompressed file stored in gzip file (fileName)
func PackFolder ¶
PackFolder packs input folder into output tar file. ".tar" extension is added to the output file name.
Example: PackFolder("user/projectsfolder", "projects") generates "./projects.tar"
Types ¶
This section is empty.