CommonUtil.GenerateHash Method (Byte[])

MultiArchive SDK .NET

Collapse image Expand Image Copy image CopyHover image

[This is preliminary documentation and is subject to change.]

Utility method that generates an MD5 hash from a byte array.

Namespace: MultiArchive.SDK.ServiceUtils
Assembly: MultiArchive.SDK (in MultiArchive.SDK.dll) Version: 1.2.30.413 (1.2.30.413)

Syntax

C#
public static string GenerateHash(
	byte[] itemContent
)
Visual Basic
Public Shared Function GenerateHash ( 
	itemContent As Byte()
) As String
Visual C++
public:
static String^ GenerateHash(
	array<unsigned char>^ itemContent
)

Parameters

itemContent
Type: array<System..::..Byte>[]()[][]
A byte array containing the content for which a hash should be generated.

Return Value

Type: String
A string containing the generated MD5 hash.

Examples

C#  Copy imageCopy
class TestClass
{
    static void Main() 
    {
        UTF8Encoding enc = new UTF8Encoding();
        byte[] byteContent = enc.GetBytes("Hello World.");
        string md5Hash = CommonUtils.GenerateHash(byteContent);
    }
}

Exceptions

Exception Condition
MultiArchive.SDK.Services.Exceptions..::..ItemException Throws an ItemException if the bytearray itemContent is empty.

See Also