I am trying to upload a file into AWS (since I am testing I am using a dockerized minio).
const fileContent = await readFile(fileName, {
encoding: "binary",
});
const checksum = checksums.crc32(fileContent);
UploadId
for future use here.for
loop.CompleteMultipartUploadCommand
.If I remove line 77 and 78:
ChecksumType: "FULL_OBJECT",
ChecksumCRC32: checksum.toString(),
It will upload the file but that is not what I want.
CompleteMultipartUploadCommand
.Upload
class exported from @aws-sdk/lib-storage but I was not able to make sense of how they are doing a FULL_OBJECT
checksum check.First, thanks in advance for you're answer.
Please if possible add a link to a repo or share some example.
Explain what I do not know about this holy grail of checksum & data integrity check.
I am not exactly familiar with how AWS S3 is generating those CRC32 checksums since the ones I was able to generate are all numbers and nothing like things AWS S3 returns as your checksum. You can look at the logs of Parts
, here is one of them:
ChecksumCRC32: 'VG/A4w=='
Whereas the one I generate from the entire file is 209188370
, a number!
So maybe someone out there know how in NodeJS I can generate the same CRC32 as AWS folks do since I feel like my code is broken somehow.
So here is the thing:
And make sure to watch my YouTube video about this: https://youtu.be/Pgl_NmbxPUo.