始终生成相同的ipfs哈希
let horseFile = fs.readFileSync("C:/Users/Priyaka/Desktop/latest_horce_chain/assets/q2.jpg"); let horseBuffer = new Buffer.from(horseFile); ipfs.files.add(horseBuffer, function (err, file) { if (err) { console.log(err); } let ipfs_hash =file[0].hash;
let pedigreeFile = fs.readFileSync("C:/Users/Priyaka/Desktop/latest_horce_chain/assets/q1.jpg"); let PedBuffer = new Buffer.from(pedigreeFile); ipfs.files.add(PedBuffer, function (err, files) { if (err) { console.log(err); } // let ipfs_hash_ped_img =''; let ipfs_hash_ped_img =files[0].hash; console.log(ipfs_hash_ped_img);
两个图片的哈希值不同