Cert API never stores any document or file used during the process. The document is double hashed and the result is registered on Blockchain as an evidence.

In terms of using the double hashing method, you can try any of the following methods or replicate the code in your preferred programming language.

To validate we obtain same result in both sides (API side and yours), you can try to double hash this file: filetohash.pdf to obtain the following double hash result.

Double hash: 2c124ab4054cfd34c00ac8fbde3f17d0fb6d512b26396626558d06b594061b4a

To help the hash replication process, you can check first hash and second hash are aligned:

First hash: dc8144e66121409a4e4a97e02670e39a3bd40d86911a368ec1c6760671f375ba

Double hash: 2c124ab4054cfd34c00ac8fbde3f17d0fb6d512b26396626558d06b594061b4a

Download the filetohash.pdf file here 👇

📁 filetohash.pdf

Check out the double hash method in any of these languages:

const fs = require("fs");
const crypto = require("crypto-js");

function hash(content) {
	try {
		// First hash (WordArray hash)
		const wordArray = crypto.lib.WordArray.create(content);
		const firstHash = crypto.SHA256(wordArray);
		const firstHashHex = firstHash.toString(crypto.enc.Hex);
		console.log("First hash:" + firstHashHex);

		// Second hash (WordArray hash)
		const firstHashWordArray = crypto.enc.Hex.parse(firstHashHex);
		const secondHash = crypto.SHA256(firstHashWordArray);
		const secondHashHex = secondHash.toString(crypto.enc.Hex);
		console.log("Double hash:" + secondHashHex);

		// Returns the double hash
		return secondHashHex;
	} catch (err) {
		console.log(`Error hashing the file content: ${err}`);
		throw err;
	}
}
const filePath = "./filetohash.pdf";
const fileContent = fs.readFileSync(filePath, {});
hash(fileContent);