| ClassPath: | MEng.System.Runtime.MD5Digest |
| Parent ClassPath: | MEng.Object |
| Copyable: | No |
| Final: | Yes |
MEng.System.Runtime.MD5Digest implements the MD5 hashing algorithm. MD5 is widely used in cryptography, digital signature systems, unique id generation, and so forth. It takes in a series of bytes of some content (file, password, etc...) and spits out a 128 bit hash that is, for all practical purposes, a unique identifier for that series of input bytes. The number of possible hash values (2 to the 128th power) is so huge that it is extremely unlikely that any other non-trivial sequence of bytes would create the same hash.
When a hash is generated, it puts the results into an MEng.System.Runtime.MD5Hash object. It doesn't use a standard memory buffer (MEng.System.Runtime.MemBuf) because MD5 hashes have a specific size and much always be of that size. You can though copy the bytes out to a memory buffer if you want to.
Constructors:
Constructor();
There is just a default constructor available, since there is no information required to create an MD5 digest.
Final, Non-Const Methods:
DigestBuf
(
[Out] MEng.System.Runtime.MD5Hash ToFill
, [In] MEng.System.Runtime.MemBuf SrcBuf
, [In] MEng.Card4 ByteCount
);This method will digest ByteCount bytes from the SrcBuf memory buffer and generate an MD5 hash into the ToFill parameter.
DigestStr
(
[Out] MEng.System.Runtime.MD5Hash ToFill
, [In] MEng.String SrcStr
);This method will digest the characters from the SrcStr string and generate an MD5 hash into the ToFill parameter. Note that, to create a consistent result regardless of the local Unicode form or endianness, the text of the string is converted to the UTF-8 encoding, and the resulting bytes, without any byte order mark, are hashed. If you need any other encoding, you can transcode the string to a buffer first, and call DigestBuf on that buffer.