将VB.NET代码转换为PHP

问题描述 投票:-5回答:2

我在VB.Net中有代码转换为MD5字符串,但我想将其转换为具有相同值返回值的phpVB.Net代码:

Public Shared Function ConverFileName(ByVal FileName As String) As String
        Dim str2 As String = ""
        Dim provider As New MD5CryptoServiceProvider
        Try 
            Dim buffer As Byte() = provider.ComputeHash(Encoding.Default.GetBytes(FileName))
            Dim num2 As Integer = (buffer.Length - 1)
            Dim i As Integer = 0
            Do While (i <= num2)
                str2 = (str2 & StringType.FromByte(buffer(i)))
                i += 1
            Loop
        Catch exception1 As Exception
            ProjectData.SetProjectError(exception1)
            Dim exception As Exception = exception1
            ProjectData.ClearProjectError
        End Try
        Return str2
    End Function
php vb.net md5
2个回答
0
投票

[已经有一个内置函数来计算PHP中文件的MD5哈希。


0
投票

您能帮忙从vb net更改为php to

© www.soinside.com 2019 - 2024. All rights reserved.