Пример #1
0
		public static new MD2 Create (string hashName)
		{
			object o = CryptoConfig.CreateFromName (hashName);
			// in case machine.config isn't configured to use any MD2 implementation
			if (o == null) {
				o = new MD2Managed ();
			}
			return (MD2) o;
		}
Пример #2
0
        public new static MD2 Create(string hashName)
        {
            object obj = CryptoConfig.CreateFromName(hashName);

            if (obj == null)
            {
                obj = new MD2Managed();
            }
            return((MD2)obj);
        }
Пример #3
0
        public static new MD2 Create(string hashName)
        {
            object o = CryptoConfig.CreateFromName(hashName);

            // in case machine.config isn't configured to use any MD2 implementation
            if (o == null)
            {
                o = new MD2Managed();
            }
            return((MD2)o);
        }
		public void Setup () 
		{
			hash = new MD2Managed ();
		}
Пример #5
0
        static HashAlgorithm GetAlgorithm(string name)
        {
            HashAlgorithm alg = null;

            switch(name.ToLowerInvariant())
            {
                case "md2":
                    alg = new MD2Managed();
                    break;
                case "md4":
                    alg = new MD4Managed();
                    break;
                case "md5":
                    alg = new MD5CryptoServiceProvider();
                    break;
                case "sha1":
                    alg = new SHA1CryptoServiceProvider();
                    break;
                case "sha224":
                    alg = new SHA224Managed();
                    break;
                case "sha256":
                    alg = new SHA256CryptoServiceProvider();
                    break;
                case "sha384":
                    alg = new SHA384CryptoServiceProvider();
                    break;
                case "sha512":
                    alg = new SHA512CryptoServiceProvider();
                    break;
                case "xxhash32":
                    alg = new XXHash32();
                    break;
                case "xxhash64":
                    alg = new XXHash64();
                    break;
                default:
                    throw new ArgumentException(_("Invalid algorithm."));
            }
            return alg;
        }