Beispiel #1
0
        /// <summary>
        /// This method generates the hash of the specified pixel.
        /// </summary>
        private void getImageInformation()
        {
            var image = parent.getParent().getImage();

            var color = image.getPixel(x, y);

            hexColor = Image.getColorHex(color);

            var source = new StringBuilder();

            source.Append(x.ToString());
            source.Append(y.ToString());
            source.Append(hexColor);

            using (var sha512Hash = SHA512.Create())
            {
                var sourceBytes = Encoding.UTF8.GetBytes(source.ToString());
                var hashBytes   = sha512Hash.ComputeHash(sourceBytes);
                hash = BitConverter.ToString(hashBytes).Replace("-", string.Empty);
            }
        }