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

Add support for CRC64-NVME checksum algorithm #1235

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 130 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mountpoint-s3-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rand_chacha = { version = "0.3.1", optional = true }
[dev-dependencies]
aws-config = "1.5.10"
aws-credential-types = "1.2.1"
aws-sdk-s3 = "1.65.0"
aws-sdk-s3 = "1.69.0"
aws-smithy-runtime-api = "1.7.3"
bytes = "1.9.0"
clap = { version = "4.5.23", features = ["derive"] }
Expand Down
6 changes: 6 additions & 0 deletions mountpoint-s3-client/src/checksums.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
//! Provides base64 encoding/decoding for various checksums.
pub use mountpoint_s3_crt::checksums::crc32::{self, Crc32};
pub use mountpoint_s3_crt::checksums::crc32c::{self, Crc32c};
pub use mountpoint_s3_crt::checksums::crc64nvme::{self, Crc64nvme};
pub use mountpoint_s3_crt::checksums::sha1::{self, Sha1};
pub use mountpoint_s3_crt::checksums::sha256::{self, Sha256};

use base64ct::Base64;
use base64ct::Encoding;
use thiserror::Error;

/// The base64 encoding for this CRC64-NVME checksum value.
pub fn crc64nvme_to_base64(checksum: &Crc64nvme) -> String {
Base64::encode_string(&checksum.value().to_be_bytes())
}

/// The base64 encoding for this CRC32C checksum value.
pub fn crc32c_to_base64(checksum: &Crc32c) -> String {
Base64::encode_string(&checksum.value().to_be_bytes())
Expand Down
Loading
Loading