#1 2016-06-06 08:38:13

ertank
Member
Registered: 2016-03-16
Posts: 168

SHA256 of a file

Hi,

I am mainly using SHA256 for the AES256 cryption. Recently, I needed to control if a file has changed. Size of the file is quite small (~20-30KB) and won't be increasing much. I thought I might save a SHA256 hash of the file somewhere and compare it to monitor "if file has changed"

When I tried to use SynCrypto.SHA256() I realize that it accepts RawByteString as a parameter. I believe, It may be used for file hashing, but I have no idea how to do that.

Is it possible to have an example of SynCrypto.SHA256() used for file hasing?

Thanks.

Offline

#2 2016-06-06 09:01:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,603
Website

Re: SHA256 of a file

Try using StringFromFile() function to return a RawByteString from the file name.

Offline

#3 2016-06-06 20:30:49

ertank
Member
Registered: 2016-03-16
Posts: 168

Re: SHA256 of a file

That did the job perfectly. Thank you.

Offline

Board footer

Powered by FluxBB