Skip to content

Commit

Permalink
fix: fix hash result step in foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
nidbCN committed Nov 25, 2024
1 parent 76e26ff commit 8a05369
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CameraCaptureBot.Core/BotHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ private async Task ProcessBotOnline(BotContext bot, BotOnlineEvent _)
{
var hashData = MD5.HashData(Encoding.UTF8.GetBytes(pwd.Password));
var buffer = new char[hashData.Length * 2 + 1];
for (var i = 0; i < hashData.Length; i += 2)
for (var i = 0; i < hashData.Length; i++)
{
var twoChar = ToCharsBuffer(hashData[i], 0x200020u);
buffer[i] = (char)(twoChar >> 16);
buffer[i + 1] = (char)(twoChar & 0x0000FFFFu);
buffer[2 * i] = (char)(twoChar >> 16);
buffer[2 * i + 1] = (char)(twoChar & 0x0000FFFFu);
}

buffer[^1] = '\0';
Expand Down

0 comments on commit 8a05369

Please sign in to comment.