コード例 #1
0
 public PolynomialSequenceHasher(int polynomBase, IObjectHasher hasher = null, int defaultCapacity = 10000)
 {
     this.polynomBase = polynomBase;
     this.hasher      = hasher ?? new DefaultObjectHasher();
     InitBasePowers(defaultCapacity);
     Reset();
 }
コード例 #2
0
        public static string ComputeHash(this object sourceObject, ObjectHasherAlgorithmTypeEnum algorithm = ObjectHasherAlgorithmTypeEnum.MD5)
        {
            IObjectHasher objectHasher = null;

            switch (algorithm)
            {
            case ObjectHasherAlgorithmTypeEnum.MD5:
                objectHasher = new MD5HashGenerator();
                break;
            }

            return(objectHasher.ComputeHash(sourceObject));
        }