Documentation ¶
Overview ¶
Package crypto provides the file utilities. Use this package's utilities to prepare for uploading file and get data from downloaded files.
Index ¶
- func CalFileHash(f *os.File) (hash string, err error)
- func DecryptFile(inFile, outFile *os.File, key []byte) (hash string, err error)
- func EncryptFile(inFile, outFile *os.File, keyAes []byte) (hash string, err error)
- func GenerateFileInfo(target, publicKey, keyAes string, dataShards, parShards int) (info tpStorage.FileInfo, err error)
- func MergeFile(inPath string, hashes []string, outFile *os.File, ...) error
- func SplitFile(inFile *os.File, outPath string, dataShards, parShards int) (hashes []string, fragmentSize int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalFileHash ¶
CalFileHash calculate the hash of file.
func DecryptFile ¶
DecryptFile decrypt the file using AES-CTR. After decryption, calculate the hash of file.
func EncryptFile ¶
EncryptFile encrypt the file using AES-CTR. After encryption, calculate the hash of file.
func GenerateFileInfo ¶
func GenerateFileInfo(target, publicKey, keyAes string, dataShards, parShards int) (info tpStorage.FileInfo, err error)
GenerateFileInfo generate the information of file for SeaStorage file system. If the size of file smaller than the default large file size limitation, the file will be split using RS erasure coding, else the file will keep origin
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.