Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
coreospackage
Merge requests
!51
GetAttributeBasedHashByParameters added
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
GetAttributeBasedHashByParameters added
GetAttributeBasedHash
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Sandeep S. Shewalkar
requested to merge
GetAttributeBasedHash
into
master
6 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
GetAttributeBasedHashByParameters added to calculate hash without accessing file
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
f7cd7523
1 commit,
6 years ago
1 file
+
10
−
0
Expand all files
Preferences
File browser
List view
Tree view
Compare changes
Inline
Side-by-side
Show whitespace changes
Show one file at a time
securityhelper/securityHelper.go
+
10
−
0
Options
@@ -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
)
Menu
Explore
Projects
Groups
Topics
Snippets