MCPcopy Index your code
hub / github.com/Mathieu2301/TradingView-API / genSessionID

Function genSessionID

src/utils.js:8–13  ·  view source on GitHub ↗

* Generates a session id * @function genSessionID * @param {String} type Session type * @returns {string}

(type = 'xs')

Source from the content-addressed store, hash-verified

6 * @returns {string}
7 */
8 genSessionID(type = 'xs') {
9 let r = '';
10 const c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
11 for (let i = 0; i < 12; i += 1) r += c.charAt(Math.floor(Math.random() * c.length));
12 return `${type}_${r}`;
13 },
14
15 genAuthCookies(sessionId = '', signature = '') {
16 if (!sessionId) return '';

Callers 6

ChartSessionClass · 0.85
replayStepMethod · 0.85
replayStartMethod · 0.85
replayStopMethod · 0.85
ChartStudyClass · 0.85
QuoteSessionClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected