MCPcopy Index your code
hub / github.com/RustPython/RustPython / newChunkId

Function newChunkId

wasm/notebook/src/parse.js:27–37  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

25 let currentChunkStartLine = 1;
26
27 const newChunkId = (str) => {
28 const hash = hashCode(str);
29 let hashNum = '0';
30 for (const chunk of chunks) {
31 const [prevHash, prevHashNum] = chunk.chunkId.split('_');
32 if (hash === prevHash) {
33 hashNum = (parseInt(prevHashNum, 10) + 1).toString();
34 }
35 }
36 return `${hash}_${hashNum}`;
37 };
38
39 const pushChunk = (endLine) => {
40 const chunkContent = currentChunkLines.join('\n');

Callers 1

pushChunkFunction · 0.85

Calls 2

hashCodeFunction · 0.85
splitMethod · 0.45

Tested by

no test coverage detected