ExamineSHA1Fingerprint()

语法

Result = ExamineSHA1Fingerprint(#Fingerprint)
概要
Initializes the calculation of a SHA1 (Secure Hash Algorithm 1) checksum in several steps. Unlike the SHA1Fingerprint() function this allows to calculate the checksum of large data without the need to load it all into one continuous memory buffer.

参数

#Fingerprint The number to refer to this checksum calculation in later calls. #PB_Any can be used to auto-generate this number.

返回值

Returns the #FingerPrint value if #PB_Any was used for that parameter.

Remarks

NextFingerprint() can be used to add memory blocks into the calculation and FinishFingerprint() to finish the calculation and read the SHA1 hash.

See SHA1Fingerprint() for more information on the SHA1 algorithm.

示例

  *Buffer = AllocateMemory(200)                  ; Prepare a buffer with data
  If *Buffer
    PokeS(*Buffer, "The quick brown fox jumps over the lazy dog.")
    Length = MemoryStringLength(*Buffer)
    
    If ExamineSHA1Fingerprint(1)                 ; start the calculation
      NextFingerprint(1, *Buffer, Length/2)          ; calculate part 1
      NextFingerprint(1, *Buffer+Length/2, Length/2) ; calculate part 2
      
      SHA1$ = FinishFingerprint(1)               ; finish calculation
      Debug "SHA1 checksum = " + SHA1$
      
      SHA1$ = SHA1Fingerprint(*Buffer, Length)   ; compare to a calculation in 1 step
      Debug "SHA1 checksum = " + SHA1$
    EndIf

    FreeMemory(*Buffer)
  EndIf

参阅

SHA1Fingerprint(), SHA1FileFingerprint(), MD5Fingerprint(), CRC32Fingerprint()

已支持操作系统

所有

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