-
Notifications
You must be signed in to change notification settings - Fork 0
Checksum #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
yurii-litvinov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тестов не хватает
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вроде как у него нет никаких причин быть не static
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не, всё-таки возвращать хешер должен был хеш, а не его строковое представление. Мы же не знаем, как он может быть использован в дальнейшем.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Потенциально длительные операции в современном мире должны быть асинхронными, а считать хеш точно может быть долго.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Некий копипаст с предыдущим методом. Можно было бы сделать один метод и параметризовать его лямбдой. И сделать два метода-обёртки, чтобы клиенту не надо было лямбду передавать.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) | |
| using (FileStream fileStream = new(filePath, FileMode.Open, FileAccess.Read)) |
Древний C#, значит генерено нейросетью :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
! не используйте вовсе. А ну как там null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Есть статическая версия ComputeHash (правда, называется HashData), которая позволила бы это записать в одну строчку. Объект-то Вам тут не нужен.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Уже давно в C# не надо писать один тип дважды. Тем более такой.
No description provided.