-
Notifications
You must be signed in to change notification settings - Fork 17
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
Bind SHA256/SHA1/MD5 Update/Finalize API #228
Conversation
Could we also include adding update() and finalize() to MD5 hashing? |
@@ -5,6 +5,64 @@ import struct Foundation.Data | |||
import struct Foundation.TimeInterval | |||
import AwsCCal | |||
|
|||
public enum HashAlgorithm { |
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.
are we exposing crc's differently already?
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.
Yeah, CRC32/CRC32C has a different API https://github.com/awslabs/aws-crt-swift/blob/main/Source/AwsCommonRuntimeKit/crt/Checksums.swift#L11.
} | ||
} | ||
|
||
public func finalize(truncate: Int = 0) throws -> Data { |
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.
nit: truncate almost sounds like a boolean on whether result needs to be truncated or not, but in reality its the number of bytes to truncate to. better name?
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.
Thanks, updated to truncateTo
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.