CryptoSys API Library Manual

Example: Md5.BytesHash 

[VB6 equivalent: MD5_BytesHash]

Dim abData(2) As Byte   ' Create 3-byte array (NB zero-based)
Dim abDigest() As Byte
Dim i As Integer

' Setup byte array with "abc"
abData(0) = Asc("a")
abData(1) = Asc("b")
abData(2) = Asc("c")

' Compute MD5 hash digest of input
abDigest = Md5.BytesHash(abData)

' Now carry out repeated hashes of the 16-byte-long digest
For i = 2 To 1000
    abDigest = Md5.BytesHash(abDigest)
Next

' Print H(1000) in hex format
Console.WriteLine(Cnv.ToHex(abDigest))

See Also:
Md5.BytesHash Method

[Contents] [Index]

[PREV: Example: Md5.AddData ...]   [Contents]   [Index]   
   [NEXT: Example: Md5.HexHash ...]

Copyright © 2001-23 D.I. Management Services Pty Ltd. All rights reserved. Generated 2023-05-20T13:01:10Z.