Commit f7cd7523 authored by Sandeep S. Shewalkar's avatar Sandeep S. Shewalkar
Browse files

GetAttributeBasedHashByParameters added

GetAttributeBasedHashByParameters added to calculate hash without accessing file
parent 237d3fa0
Branches
1 merge request!51GetAttributeBasedHashByParameters added
Showing with 10 additions and 0 deletions
......@@ -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)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment