Hi everyone; I would like to incorporate into my script that recursively lists all files in a folder/directory the ability to also generate an SHA1 checksum (or any really) for that file. I would appreciate any leads someone could offer on the matter.
I have a function I was using for other purposes that does SHA - maybe that can be modified?
However, here I am hashing a URL whereas with the file I guess I can't just use the file-name but need to get further access.
Thanks!
I have a function I was using for other purposes that does SHA - maybe that can be modified?
Code:
Function Base64_HMACSHA1(ByVal sTextToHash As String, ByVal sSharedSecretKey As String)
Dim asc As Object, enc As Object
Dim TextToHash() As Byte
Dim SharedSecretKey() As Byte
Dim bytes() As Byte
Set asc = CreateObject("System.Text.UTF8Encoding")
Set enc = CreateObject("System.Security.Cryptography.HMACSHA1")
'Only need to hash path
sTextToHash = Replace(sTextToHash, "https://maps.googleapis.com", "")
TextToHash = asc.Getbytes_4(sTextToHash)
'Decode sSharedSecretKey
SharedSecretKey = DecodeBase64(sSharedSecretKey)
'SharedSecretKey = asc.Getbytes_4(sSharedSecretKey)
enc.key = SharedSecretKey
bytes = enc.ComputeHash_2((TextToHash))
Base64_HMACSHA1 = EncodeBase64(bytes)
However, here I am hashing a URL whereas with the file I guess I can't just use the file-name but need to get further access.
Thanks!