azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

[FEATURE REQ] Support transactional CRC64 checksums

Open Gezi-lzq opened this issue 1 month ago • 4 comments

Is your feature request related to a problem? Please describe: The current Azure Java SDK (v12) appears to lack built-in support for transactional CRC64 validation during blob transfers. While the .NET SDK provides a UseTransactionalCRC64 property (in ChecksumOptions) and StorageChecksumAlgorithm.StorageCrc64 (in v12) to automatically calculate and validate CRC64 hashes for individual REST operations, the Java SDK primarily relies on MD5 (setComputeMd5).

For scenarios where CRC64 is preferred (e.g., performance considerations on certain hardware or specific compliance requirements), or when migrating legacy systems that rely on CRC64 validation, the lack of a direct configuration in ParallelTransferOptions or BlobUploadOptions forces developers to manually implement complex custom logic or fallback to MD5.

Describe the solution you'd like: I would like to request first-class support for transactional CRC64 validation in the Java SDK, similar to the .NET implementation.

Ideally, this would look like:

  • Adding a method like setComputeCrc64(boolean) to ParallelTransferOptions.
  • Or introducing a setChecksumAlgorithm(StorageChecksumAlgorithm) method where one can choose between MD5 and CRC64.
  • The SDK should handle the calculation of the CRC64 hash for the block/blob and set the x-ms-content-crc64 header automatically during upload/download.

Describe alternatives you've considered:

  • Using MD5 (setComputeMd5(true)), which is currently supported but may not meet specific requirements.
  • Relying solely on HTTPS/TLS for transport layer security, which doesn't protect against application-level data corruption.
  • Manually calculating CRC64 and setting headers, which is error-prone and difficult to integrate with the high-level BlobClient convenience methods.

Additional context:

  • .NET SDK Reference: ChecksumOptions.UseTransactionalCRC64
  • REST API Reference: x-ms-content-crc64 header support.
  • Parity with other language SDKs (like .NET and Go) would improve the cross-platform developer experience.

Gezi-lzq avatar Dec 03 '25 03:12 Gezi-lzq

@ibrandes Could you look at supporting the x-ms-content-crc64 header in Java?

samvaity avatar Dec 04 '25 21:12 samvaity

Hi @Gezi-lzq,

This feature is currently being implemented. We are targeting its release towards the end of Q1 next year.

ibrandes avatar Dec 04 '25 22:12 ibrandes

Will there be support in the future, similar to AWS CRT, to introduce a C-language implementation libs of the crc32c algorithm and leverage hardware acceleration? @ibrandes

Gezi-lzq avatar Dec 09 '25 12:12 Gezi-lzq

@Gezi-lzq

We don't have any official plans for it yet, but it has been something on our radar. After CRC64 checksum support is fully implemented, we will be able to give it more consideration.

ibrandes avatar Dec 09 '25 18:12 ibrandes