MCPcopy Create free account
hub / github.com/apify/crawlee-python / encodeAndSign

Function encodeAndSign

website/roa-loader/index.js:60–87  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

58}
59
60async function encodeAndSign(source) {
61 if (!process.env.APIFY_SIGNING_TOKEN) {
62 return 'invalid-token';
63 }
64
65 if (working) {
66 return new Promise((resolve, reject) => {
67 queue.push(() => {
68 return getHash(source).then(resolve, reject);
69 });
70 });
71 }
72
73 let res;
74
75 try {
76 working = true;
77 res = await getHash(source);
78
79 while (queue.length) {
80 await queue.shift()();
81 }
82 } finally {
83 working = false;
84 }
85
86 return res;
87}
88
89module.exports = async function (code) {
90 if (process.env.CRAWLEE_DOCS_FAST) {

Callers 1

index.jsFile · 0.85

Calls 1

getHashFunction · 0.85

Tested by

no test coverage detected