Fingerprint()

Syntax

Result$ = Fingerprint(*Buffer, Size, Plugin [, Bits])
Description
Returns a fingerprint for the given buffer.

Parameters

*Buffer The buffer containing the data.
Size The size of the given buffer.
Plugin The plugin to use. It can be one of the following value:
  #PB_Cipher_CRC32: uses CRC32 algorithm. UseCRC32Fingerprint() needs to be called before to register this plugin.
  #PB_Cipher_MD5  : uses MD5 algorithm. UseMD5Fingerprint() needs to be called before to register this plugin.
  #PB_Cipher_SHA1 : uses SHA1 algorithm. UseSHA1Fingerprint() needs to be called before to register this plugin.
  #PB_Cipher_SHA2 : uses SHA2 algorithm. UseSHA2Fingerprint() needs to be called before to register this plugin.
  #PB_Cipher_SHA3 : uses SHA3 algorithm. UseSHA3Fingerprint() needs to be called before to register this plugin.
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.

Return value

Returns the fingerprint as an hexadecimal string.

Example

  UseMD5Fingerprint()

  *Buffer = AllocateMemory(500)    
  If *Buffer
    PokeS(*Buffer, "The quick brown fox jumps over the lazy dog.", -1, #PB_Ascii)
    MD5$ = Fingerprint(*Buffer, MemoryStringLength(*Buffer, #PB_Ascii), #PB_Cipher_MD5)
    Debug "MD5 Fingerprint = " + MD5$
    FreeMemory(*Buffer)  ; would also be done automatically at the end of the program
  EndIf

See Also

FileFingerprint(), StartFingerprint(), StringFingerprint()

Supported OS

All

<- FileFingerprint() - Cipher Index - FinishCipher() ->