Skip to content

Conversation

@Andrw-404
Copy link
Owner

No description provided.

@Andrw-404 Andrw-404 changed the title add: task Checksum Nov 11, 2025
Copy link

@yurii-litvinov yurii-litvinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тестов не хватает

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вроде как у него нет никаких причин быть не static

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не, всё-таки возвращать хешер должен был хеш, а не его строковое представление. Мы же не знаем, как он может быть использован в дальнейшем.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Потенциально длительные операции в современном мире должны быть асинхронными, а считать хеш точно может быть долго.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Некий копипаст с предыдущим методом. Можно было бы сделать один метод и параметризовать его лямбдой. И сделать два метода-обёртки, чтобы клиенту не надо было лямбду передавать.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
using (FileStream fileStream = new(filePath, FileMode.Open, FileAccess.Read))

Древний C#, значит генерено нейросетью :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

! не используйте вовсе. А ну как там null?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть статическая версия ComputeHash (правда, называется HashData), которая позволила бы это записать в одну строчку. Объект-то Вам тут не нужен.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Уже давно в C# не надо писать один тип дважды. Тем более такой.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants