-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Replace the internal sha512 implementation with .Net built in sha512 #390
Replace the internal sha512 implementation with .Net built in sha512 #390
Conversation
@mtmk is this a flapper: https://github.com/nats-io/nats.net.v2/actions/runs/7855013069/job/21436316896?pr=390#step:7:302 It's the |
yes. we have #344 to take care of them soon. |
/// <summary> | ||
/// Allocation and initialization of the new SHA-512 object. | ||
/// </summary> | ||
public Sha512() | ||
{ | ||
_buffer = new byte[BlockSize];//todo: remove allocation | ||
Init(); | ||
_sha512Inner = SHA512.Create(); |
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.
is this disposable?
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.
is this disposable?
Yes it is, doh!! I'll add disposable on the wrapper and make sure we dispose it where appropriate
Sorry about that, should have caught this myself.
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.
@mtmk Added IDisposable and usings where needed.
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.
LGTM thanks @niklasfp 💯
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.
LGTM
This pr replaces the internal implementation of Sha512 to use the Sha512 in the .Net framwork.
It also removes the files that were there only to support the internal Sha512 implementation.
The benefits are:
Removed methods
This pr also removes some methods from the
Sha512
internal wrapper class, they were all unused internal methods.Micro benchmarks