Ejemplo n.º 1
0
        /// <summary>
        /// Computes a fingerprint for looking up fingerprint store
        /// </summary>
        private static ContentFingerprint ComputeFingerprint(
            string key,
            string environment)
        {
            using (var hasher = new BasicHashingHelper(recordFingerprintString: false))
            {
                hasher.Add("Type", "FingerprintStoreFingerprint");
                hasher.Add("FormatVersion", FingerprintStore.FormatVersion.Version.ToString());
                hasher.Add("LookupVersion", FingerprintStoreLookupVersion);
                hasher.Add("Key", key);
                hasher.Add("Environment", environment);

                var fingerprint = new ContentFingerprint(hasher.GenerateHash());
                return(fingerprint);
            }
        }
        /// <summary>
        /// Computes a fingerprint for looking up fingerprint store
        /// </summary>
        private static ContentFingerprint ComputeFingerprint(
            string key,
            IConfiguration configuration)
        {
            var extraFingerprintSalts = new ExtraFingerprintSalts(
                configuration,
                configuration.Cache.CacheSalt,
                null);

            using (var hasher = new BasicHashingHelper(recordFingerprintString: false))
            {
                hasher.Add("Type", "FingerprintStoreFingerprint");
                hasher.Add("FormatVersion", FingerprintStore.FormatVersion.Version.ToString());
                hasher.Add("LookupVersion", FingerprintStoreLookupVersion);
                hasher.Add("Key", key);
                hasher.Add("FingerprintSalt", extraFingerprintSalts.FingerprintSalt);

                var fingerprint = new ContentFingerprint(hasher.GenerateHash());
                return(fingerprint);
            }
        }