2019独角兽企业重金招聘Python工程师标准>>>
''' <summary>''' Hmac-md5加密算法。''' </summary>''' <param name="APassWord">加密串(即密码)</param>''' <param name="ASourceStr">原始字符串</param>''' <returns></returns>''' <remarks></remarks>Public Shared Function HMACMD5(ByVal APassWord As String, ByVal ASourceStr As String) As StringDim passWordByteAry() As Byte = Encoding.UTF8.GetBytes(APassWord) '密码字符串字节数组Dim sourceStrByteAry() As Byte = Encoding.UTF8.GetBytes(ASourceStr) '原始字符串字节数组Dim Hmac_Md5 As New System.Security.Cryptography.HMACMD5(passWordByteAry)Dim resultByteAry() As Byte = Hmac_Md5.ComputeHash(sourceStrByteAry)Dim resultSb As New Text.StringBuilderFor Each b As Byte In resultByteAryresultSb.Append(b.ToString("x2"))NextReturn resultSb.ToStringEnd Function