class NonceGenerator
{
public static NonceGenerator instance = new NonceGenerator();
public static NonceGenerator getInstance()
{
return instance;
}
public static string md5(string password)
{
MD5 md5 = new MD5CryptoServiceProvider();
byte[] res = md5.ComputeHash(Encoding.Default.GetBytes(password), 0, password.Length);
StringBuilder builder = new StringBuilder();
foreach (byte b in res)
{
builder.Append(Convert.ToString(b, 16));
}
return builder.ToString();
}
public static string md5(string spid, string created, string sppassword)
{
String password = spid + created + sppassword;
MD5 md5 = new MD5CryptoServiceProvider();
byte[] res = md5.ComputeHash(Encoding.Default.GetBytes(password), 0, password.Length);
StringBuilder builder = new StringBuilder();
foreach (byte b in res)
{
builder.Append(Convert.ToString(b, 16));
}
return builder.ToString();
}
}