将GetBytes,ComputeHash从C#转换为C ++

时间:2018-07-23 08:49:59

标签: c++ string byte converter

我要完成将源代码从C#转换为C ++的任务。我的C#代码如下:

using (System.Security.Cryptography.MD5CryptoServiceProvider md5Hasher = new System.Security.Cryptography.MD5CryptoServiceProvider())
{
    System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
    byte[] hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes(input));
    return BitConverter.ToString(hashedBytes).Replace("-", "").ToLower();
}

我对这些代码有麻烦。有人可以帮我吗?详细地说,我正在尝试编写函数GetBytes。但是我不知道。

0 个答案:

没有答案