GetAttributeBasedHashByParameters added

Merged Sandeep S. Shewalkar requested to merge GetAttributeBasedHash into master
Compare and
1 file
+ 10
0
Preferences
File browser
Compare changes
@@ -128,6 +128,16 @@ func GetAttributeBasedHash(filePath string) (string, error) {
return customFileHash, nil
}
// GetAttributeBasedHashBasedOnParameters - return custom hash based on file attributes
func GetAttributeBasedHashByParameters(fileModTime string, fileSize string) (string, error) {
modTime, _ := strconv.ParseInt(fileModTime, 10, 64)
fSize, _ := strconv.ParseInt(fileSize, 10, 64)
customFileHash := strconv.FormatInt((modTime + fSize), 10)
return customFileHash, nil
}
//AESEncryptDefault method to encrypt with default config (securityKey)
func AESEncryptDefault(plainText []byte) ([]byte, error) {
compressedText, compressionError := Compress(plainText)