Mega modification time and hash

I developed a patch for library gomega, so now we have support read and write of modification time.
Here Manage modification time and SSL for upload file by etmatrix · Pull Request #39 · t3rm1n4l/go-mega · GitHub there is the PR.
I have some doubts on my code, this is the first time I use golang, I used C.memcpy is there a good alternative?
I must seek in file for calculate crc32 so I used os.File interface but rclone pass me a io.Reader interface.
Someone can give me some suggestions for improve it?
Attributes of file in Mega has the following struct
4 x crc32 = 16 bytes
1 byte => count of bytes of array of serialized modtime
1-8 bytes => serialized mod time

I think the first 16 bytes can be replaced with md5sum, this operation break the compatibility with other apps but with an option in configuration account we can choose if use standard crc32 or md5sum
So the check operation can use hash or modtime + size.

Thank you for your suggestions.

This is my commit for manage mega modification time on rclone. I don't make a PR because I think is not a good solution, but works.
I will try to implement also hash with md5 and an option for accept the break of compatibility.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.