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); }
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, });