MCPcopy
hub / github.com/ampproject/amphtml / scopeBaseCid_

Method scopeBaseCid_

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

* * @param {!Promise} persistenceConsent * @param {*} scope * @param {!Location} url * @return {*}

(persistenceConsent, scope, url)

Source from the content-addressed store, hash-verified

271 * @return {*}
272 */
273 scopeBaseCid_(persistenceConsent, scope, url) {
274 return getBaseCid(this, persistenceConsent).then((baseCid) => {
275 return Services.cryptoFor(this.ampdoc.win).sha384Base64(
276 baseCid + getProxySourceOrigin(url) + scope
277 );
278 });
279 }
280
281 /**
282 * Checks if the page has opted in CID API for the given scope.

Callers 1

getExternalCid_Method · 0.95

Calls 4

getBaseCidFunction · 0.85
getProxySourceOriginFunction · 0.85
sha384Base64Method · 0.80
thenMethod · 0.45

Tested by

no test coverage detected