mirror of
https://github.com/Drop-OSS/droplet.git
synced 2025-11-09 20:12:18 +10:00
Converting to md5
This commit is contained in:
@ -14,6 +14,7 @@ time = "0.3.36"
|
||||
hex = "0.4.3"
|
||||
gxhash = "=2.3.0"
|
||||
serde_json = "1.0.128"
|
||||
md5 = "0.7.0"
|
||||
|
||||
[dependencies.serde]
|
||||
version = "1.0.210"
|
||||
|
||||
@ -39,6 +39,7 @@ test("numerous small file", async (t) => {
|
||||
];
|
||||
for (let index in checksums) {
|
||||
const entry = manifest[index.toString()];
|
||||
console.log(`Entry: ${entry}`);
|
||||
if (!entry) return t.fail(`manifest missing file ${index}`);
|
||||
|
||||
const checksum = entry.checksums[0];
|
||||
|
||||
@ -102,10 +102,8 @@ pub fn generate_manifest(
|
||||
}
|
||||
|
||||
let chunk_id = Uuid::new_v4();
|
||||
let mut checksum_generate = GxHasher::with_seed(0);
|
||||
checksum_generate.write(&buffer);
|
||||
let checksum = checksum_generate.finish_u128();
|
||||
let checksum_string = hex::encode(checksum.to_le_bytes());
|
||||
let checksum = md5::compute(buffer).0;
|
||||
let checksum_string = hex::encode(checksum);
|
||||
|
||||
chunk_data.ids.push(chunk_id.to_string());
|
||||
chunk_data.checksums.push(checksum_string);
|
||||
|
||||
Reference in New Issue
Block a user