MCPcopy Create free account
hub / github.com/ampproject/amphtml / createCidData

Function createCidData

src/service/cid-impl.js:616–621  ·  view source on GitHub ↗

* Creates a JSON object that contains the given CID and the current time as * a timestamp. * @param {string} cidString * @return {string}

(cidString)

Source from the content-addressed store, hash-verified

614 * @return {string}
615 */
616function createCidData(cidString) {
617 return JSON.stringify({
618 'time': Date.now(),
619 'cid': cidString,
620 });
621}
622
623/**
624 * Gets the persisted CID data as a promise. It tries to read from

Callers 1

storeFunction · 0.85

Calls 2

stringifyMethod · 0.80
nowMethod · 0.80

Tested by

no test coverage detected