23
24
export function getWorkspaceIdentifier(configPath: URI): IWorkspaceIdentifier {
26
>
function getWorkspaceId(): string {
27
>
let configPathStr = configPath.scheme === Schemas.file ? originalFSPath(configPath) : configPath.toString();
28
>
if (!isLinux) {
29
configPathStr = configPathStr.toLowerCase(); // sanitize for platform file system
30
}
32
>
return createHash('md5').update(configPathStr).digest('hex'); // CodeQL [SM04514] Using MD5 to convert a file path to a fixed length
33
>
}
34
>
35
>
return {
36
>
id: getWorkspaceId(),
37
>
configPath
38
>
};
39
>
}
40
41
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!