SPUtility.CryptSafeEquals method

SharePoint 2013

Test two strings for equality in such a way that the execution time of the compare is independent of which bytes in the strings are equal.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

'Declaration
Public Shared Function CryptSafeEquals ( _
	str1 As String, _
	str2 As String _
) As Boolean
'Usage
Dim str1 As String
Dim str2 As String
Dim returnValue As Boolean

returnValue = SPUtility.CryptSafeEquals(str1, _
	str2)

Parameters

str1
Type: System.String

The first string to compare

str2
Type: System.String

The second string to compare

Return value

Type: System.Boolean
Show: