You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
607 B
26 lines
607 B
using System;
|
|
using System.Text;
|
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
|
namespace Sog.Crypto
|
|
{
|
|
/// <summary>
|
|
/// 游客账号加密模块
|
|
/// </summary>
|
|
public static class GuestAccountCrypto
|
|
{
|
|
public static string GetAccountToken(string accountId)
|
|
{
|
|
|
|
SHA1 sha1 = new SHA1CryptoServiceProvider();
|
|
byte[] dataIn = System.Text.Encoding.UTF8.GetBytes(accountId + "-xGame");
|
|
byte[] dataOut = sha1.ComputeHash(dataIn);
|
|
|
|
string str = BitConverter.ToString(dataOut);
|
|
return str.Replace("-", "");
|
|
}
|
|
|
|
}
|
|
}
|
|
|