You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-06 02:11:06 +09:00
Warnings and minor inconsistencies fixed
This commit is contained in:
@@ -31,6 +31,7 @@ using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Lidgren.Network
|
||||
{
|
||||
@@ -592,5 +593,23 @@ namespace Lidgren.Network
|
||||
}
|
||||
return bdr.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a SHA1 digest from a string
|
||||
/// </summary>
|
||||
public static byte[] CreateSHA1Hash(string key)
|
||||
{
|
||||
using (var sha = SHA1.Create())
|
||||
return sha.ComputeHash(Encoding.UTF8.GetBytes(key));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a SHA1 digest from a byte buffer
|
||||
/// </summary>
|
||||
public static byte[] CreateSHA1Hash(byte[] data)
|
||||
{
|
||||
using (var sha = SHA1.Create())
|
||||
return sha.ComputeHash(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user