New to Telerik UI for WinForms? Start a free 30-day trial

MD5Core

Class

Computes MD5 message digests for byte arrays and encoded text.

MD5 is not suitable as a general-purpose cryptographic hash for security-sensitive use.

Definition

Namespace:Telerik.WinForms.Documents.Utils

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public sealed class MD5Core

Inheritance: objectMD5Core

Methods

Computes the 16-byte MD5 digest of the specified bytes.

C#
public static byte[] GetHash(byte[] input)
Parameters:inputbyte[]

The bytes to hash.

Returns:

byte[]

The 16-byte MD5 digest.

Exceptions: ArgumentNullException

input is null.

Computes the 16-byte MD5 digest of a string encoded with the specified encoding.

C#
public static byte[] GetHash(string input, Encoding encoding)
Parameters:inputstring

The text to hash.

encodingEncoding

The encoding used to convert the text to bytes.

Returns:

byte[]

The 16-byte MD5 digest.

Exceptions: ArgumentNullException

input or encoding is null.

Computes the 16-byte MD5 digest of a string encoded as UTF-8.

C#
public static byte[] GetHash(string input)
Parameters:inputstring

The text to hash.

Returns:

byte[]

The 16-byte MD5 digest.

Exceptions: ArgumentNullException

input is null.

Computes an MD5 digest and formats it as uppercase hexadecimal without separators.

C#
public static string GetHashString(byte[] input)
Parameters:inputbyte[]

The bytes to hash.

Returns:

string

The 32-character hexadecimal digest.

Exceptions: ArgumentNullException

input is null.

Computes an MD5 digest of text encoded with the specified encoding and formats it as uppercase hexadecimal.

C#
public static string GetHashString(string input, Encoding encoding)
Parameters:inputstring

The text to hash.

encodingEncoding

The encoding used to convert the text to bytes.

Returns:

string

The 32-character hexadecimal digest without separators.

Exceptions: ArgumentNullException

input or encoding is null.

Computes the MD5 digest of a string encoded as UTF-8 and formats it as uppercase hexadecimal.

C#
public static string GetHashString(string input)
Parameters:inputstring

The text to hash.

Returns:

string

The 32-character hexadecimal digest without separators.

Exceptions: ArgumentNullException

input is null.