예제 #1
0
파일: PanelEx.cs 프로젝트: Mynotic/dotsetup
        private Stream Base64ToStream(Stream responseStream, string decode)
        {
            StreamReader reader         = new StreamReader(responseStream, System.Text.Encoding.UTF8);
            string       responseString = reader.ReadToEnd();

            responseStream = CryptUtils.Decode(responseString, decode);
            return(responseStream);
        }
예제 #2
0
 internal static string Process(string action, string value)
 {
     return((action.ToLower()) switch
     {
         CryptUtils.Hash.SHA1 => CryptUtils.ComputeHash(value, CryptUtils.Hash.SHA1),
         CryptUtils.Hash.MD5 => CryptUtils.ComputeHash(value, CryptUtils.Hash.MD5),
         Prefix.Encode + CryptUtils.EncDec.BASE62 => new StreamReader(CryptUtils.Encode(value, CryptUtils.EncDec.BASE62)).ReadToEnd(),
         Prefix.Decode + CryptUtils.EncDec.BASE62 => new StreamReader(CryptUtils.Decode(value, CryptUtils.EncDec.BASE62)).ReadToEnd(),
         Prefix.Encode + CryptUtils.EncDec.BASE64 => new StreamReader(CryptUtils.Encode(value, CryptUtils.EncDec.BASE64)).ReadToEnd(),
         Prefix.Decode + CryptUtils.EncDec.BASE64 => new StreamReader(CryptUtils.Decode(value, CryptUtils.EncDec.BASE64)).ReadToEnd(),
         _ => string.Empty,
     });