|
- static String GetSHA1Key(String AppId, String AppKey)
- {
- long longTime = (long)(DateTime.Now - new DateTime(1970, 01, 01)).TotalMilliseconds;
- String value = String.Format("{0}UZ{1}UZ{2}", AppId, AppKey, longTime);
- byte[] buffer = System.Security.Cryptography.SHA1.Create().ComputeHash(System.Text.Encoding.UTF8.GetBytes(value));
- System.Text.StringBuilder builder = new System.Text.StringBuilder();
- foreach (byte num in buffer)
- {
- builder.AppendFormat("{0:x2}", num);
- }
- return builder.ToString() + "." + longTime;
- }
复制代码 |
|