<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace RestImageResize.Security
{
    public class HashGenerator
    {
        public string ComputeHash(string privateKey, int width, int height, ImageTransform transform)
        {
            var values = new[] { privateKey, width.ToString(), height.ToString(), transform.ToString() };
            var bytes = Encoding.ASCII.GetBytes(string.Join(":", values));

            var sha1 = SHA1.Create();
            sha1.ComputeHash(bytes);

            return BitConverter.ToString(sha1.Hash).Replace("-", "").ToLower();
        }
    }
}<commit_msg>Use lowered transform value in hash computing<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace RestImageResize.Security
{
    public class HashGenerator
    {
        public string ComputeHash(string privateKey, int width, int height, ImageTransform transform)
        {
            var values = new[] { privateKey, width.ToString(), height.ToString(), transform.ToString().ToLower() };
            var bytes = Encoding.ASCII.GetBytes(string.Join(":", values));

            var sha1 = SHA1.Create();
            sha1.ComputeHash(bytes);

            return BitConverter.ToString(sha1.Hash).Replace("-", "").ToLower();
        }
    }
}
{'fraction_non_alphanumeric': 0.11991584852734923, 'fraction_numerical': 0.005610098176718092, 'mean_word_length': 3.053977272727273, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6633897', 'n_tokens_mistral': 376, 'n_tokens_neox': 376, 'n_words': 92}