12345678910111213141516171819202122232425262728293031323334353637 |
- /*******************************************************************************
- * iNethinkCMS - 网站内容管理系统
- * Copyright (C) 2012-2013 inethink.com
- *
- * @author jackyang <69991000@qq.com>
- * @website http://cms.inethink.com
- * @version 1.3.6.0 (2013-08-14)
- *
- * This is licensed under the GNU LGPL, version 3.0 or later.
- * For details, see: http://www.gnu.org/licenses/gpl-3.0.html
- *******************************************************************************/
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace iNethinkCMS.Command
- {
- public class Command_MD5
- {
- public static string md5(string str)
- {
- System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
- byte[] bytes = System.Text.Encoding.UTF8.GetBytes(str);
- bytes = md5.ComputeHash(bytes);
- md5.Clear();
- string ret = "";
- for (int i = 0; i < bytes.Length; i++)
- {
- ret += Convert.ToString(bytes[i], 16).PadLeft(2, '0');
- }
- return ret.PadLeft(32, '0');
- }
- }
- }
|