Page 1 of 1

File Finger Print - support SHA-256

Posted: Sat Oct 15, 2022 11:33 am
by IdeasVacuum
Result$ = FileFingerprint(Filename$, Plugin [, Bits [, Offset [, Length]]])

So many download sites are now using SHA-256 file finger prints, it would be good to catch up since the likes of MD5 and SHA-1 were 'broken' long ago.

Re: File Finger Print - support SHA-256

Posted: Sat Oct 15, 2022 11:47 am
by Mijikai
PB supports up to 512 Bits?
Optional:
viewtopic.php?t=77330

Re: File Finger Print - support SHA-256

Posted: Sat Oct 15, 2022 1:06 pm
by STARGÅTE
https://www.purebasic.com/documentation ... print.html
Bits (optional) The bits number to use for the fingerprint. It is only supported for the following plugin:
#PB_Cipher_SHA2 : can be 224, 256 (default), 384 or 512.
#PB_Cipher_SHA3 : can be 224, 256 (default), 384 or 512.

Re: File Finger Print - support SHA-256

Posted: Sun Oct 16, 2022 2:42 am
by IdeasVacuum
Hi
#PB_Cipher_SHA3 : can be 224, 256 (default), 384 or 512.
That doesn't make SHA-3 become SHA-256 though?

Re: File Finger Print - support SHA-256

Posted: Sun Oct 16, 2022 7:23 am
by STARGÅTE
I don't know what you mean.
There are three SHA generations: SHA-1, SHA-2, and SHA-3.
The generation SHA-2 splits into SHA-224, SHA-256, SHA-384 and SHA-512, depending on the used bits.

So, what you mean with SHA-256 is just:

Code: Select all

FileFingerprint(FileName, #PB_Cipher_SHA2, 256)