How to produce a different md5 hash with different encodings?
I am porting over some code from .net (vb) to php and I came across some md5 hashing that I can't reproduce in php. In the .net one there are two functions one uses UTF-8 encoding and the other uses Unicode encoding. The output is a different hash when passed in a string


    // First function (returns GUID)
    Dim oHasher As Cryptography.MD5 = Cryptography.MD5.Create()
    Dim oEncoder As New System.Text.UTF8Encoding()
    Dim csData() As Byte
    
    csData = oHasher.ComputeHash(oEncoder.GetBytes(strInput))
    
    
    // Second function (returns GUID)
    Dim oHasher As Cryptography.MD5 = Cryptography.MD5.Create()
    Dim oEncoder As New System.Text.UnicodeEncoding()
    Dim csData() As Byte
    
    csData = oHasher.ComputeHash(oEncoder.GetBytes(strInput))


In php I have tried using

    $passHash = md5(utf8_encode($password));
    $newPassHash =  md5($password);


but they both produce the same result. Is it possible to produce the same results in php with md5 hashing?
How to produce a different md5 hash with different encodings?
===

I am porting over some code from .net (vb) to php and I came across some md5 hashing that I can't reproduce in php. In the .net one there are two functions one uses UTF-8 encoding and the other uses Unicode encoding. The output is a different hash when passed in a string


    // First function (returns GUID)
    Dim oHasher As Cryptography.MD5 = Cryptography.MD5.Create()
    Dim oEncoder As New System.Text.UTF8Encoding()
    Dim csData() As Byte
    
    csData = oHasher.ComputeHash(oEncoder.GetBytes(strInput))
    
    
    // Second function (returns GUID)
    Dim oHasher As Cryptography.MD5 = Cryptography.MD5.Create()
    Dim oEncoder As New System.Text.UnicodeEncoding()
    Dim csData() As Byte
    
    csData = oHasher.ComputeHash(oEncoder.GetBytes(strInput))


In php I have tried using

    $passHash = md5(utf8_encode($password));
    $newPassHash =  md5($password);


but they both produce the same result. Is it possible to produce the same results in php with md5 hashing?