Converting a md5 hash byte array to a string

前端 未结 7 1539
余生分开走
余生分开走 2021-01-31 13:28

How can I convert the hashed result, which is a byte array, to a string?

byte[] bytePassword = Encoding.UTF8.GetBytes(password);

using (MD5 md5 = MD5.Create())
         


        
7条回答
  •  北海茫月
    2021-01-31 13:55

    You can use Convert.ToBase64String and Convert.FromBase64String to easily convert byte arrays into strings.

提交回复
热议问题