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

fix(crc64-nvme-crt): return checksum for empty string if called without data #6798

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Jan 14, 2025

Issue

Internal JS-5674

Description

Returns checksum for empty string if called without data

Testing

Verified using internal test code that CRC64VME checksum if "AAAAAAAAAAA=" when called for empty string.


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

@trivikr trivikr requested a review from a team as a code owner January 14, 2025 20:10
@@ -3,20 +3,17 @@ import { Checksum } from "@smithy/types";
import { toUint8Array } from "@smithy/util-utf8";

export class CrtCrc64Nvme implements Checksum {
private previous: DataView | undefined;
private checksum: DataView = new DataView(new ArrayBuffer(8));
Copy link
Contributor

Choose a reason for hiding this comment

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

very minor issue:

given that CrtCrc64Nvme implements Checksum, an instance of this may be called "checksum", so this private property would be checksum.checksum.

perhaps it would more correctly be called "hash"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll update this in a separate PR, since we use checksum for the private member in NodeCrc32 too.

@trivikr trivikr merged commit 473f949 into aws:main Jan 15, 2025
4 checks passed
@trivikr trivikr deleted the default-crt-crc64-nvme-checksum branch January 15, 2025 05:42
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants