Skip to content
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

Merged
merged 13 commits into from
Feb 8, 2024
Merged

Bind SHA256/SHA1/MD5 Update/Finalize API #228

merged 13 commits into from
Feb 8, 2024

Conversation

waahm7
Copy link
Contributor

@waahm7 waahm7 commented Jan 25, 2024

Issue #, if available:

Description of changes:

  • Binds support for SHA256/SHA1/MD5 update/finalize API

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dayaffe dayaffe self-requested a review January 25, 2024 19:12
@dayaffe
Copy link
Contributor

dayaffe commented Feb 6, 2024

Could we also include adding update() and finalize() to MD5 hashing?

@waahm7 waahm7 changed the title Bind SHA256/SHA1 Update/Finalize API Bind SHA256/SHA1/MD5 Update/Finalize API Feb 6, 2024
@@ -5,6 +5,64 @@ import struct Foundation.Data
import struct Foundation.TimeInterval
import AwsCCal

public enum HashAlgorithm {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}
}

public func finalize(truncate: Int = 0) throws -> Data {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, updated to truncateTo

Source/AwsCommonRuntimeKit/crt/Hash.swift Outdated Show resolved Hide resolved
@waahm7 waahm7 merged commit 0be0919 into main Feb 8, 2024
9 checks passed
@waahm7 waahm7 deleted the Fix-Hash-Update-Api branch February 8, 2024 23:14
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.

3 participants