private string GetCacheFileName(object cacheKey, int minutes)
        {
            var name = Cores.Md5(cacheKey.ToString().Trim());
            var path = $"{name[1]}\\{name[3]}\\{name[12]}\\{name[16]}\\{name[20]}\\{minutes}\\{name}.moz";

            path = Path.Combine(_cacheRootPath, path);
            return(path);
        }
Example #2
0
 /// <summary>
 /// 获取缓存键。
 /// </summary>
 /// <param name="key">缓存键。</param>
 /// <returns>返回缓存键。</returns>
 protected string GetCacheKey(object key)
 {
     return(Cores.Md5($"moz::storages::caches[{key.GetType()}::{key}]"));
 }
 private string GetTempFileName(string fileName)
 {
     return(Path.Combine(_tempRootPath, Cores.Md5(fileName)));
 }
Example #4
0
        /// <summary>
        /// 加密验证码。
        /// </summary>
        /// <param name="code">验证码。</param>
        /// <returns>返回加密后的验证码。</returns>
        public static string Hashed(string code)
        {
            const string salt = "AmazingValidateCodeForMozlite!";

            return(Cores.Md5(Cores.Sha1(salt + code.ToUpper())));
        }