Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 48 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,6 @@
"arch": "^2.1.0",
"fs-extra": "^11.2.0",
"glob": "^7.2.0",
"hash.js": "^1.1.7",
"iconv-lite": "^0.6.3",
"inversify": "^6.0.2",
"jsonc-parser": "^3.0.0",
Expand Down
7 changes: 3 additions & 4 deletions src/client/telemetry/importTracker.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable class-methods-use-this */
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

Expand All @@ -7,6 +8,7 @@ import { inject, injectable } from 'inversify';
import * as path from 'path';
import { clearTimeout, setTimeout } from 'timers';
import { TextDocument } from 'vscode';
import { createHash } from 'crypto';
import { sendTelemetryEvent } from '.';
import { IExtensionSingleActivationService } from '../activation/types';
import { IDocumentManager } from '../common/application/types';
Expand Down Expand Up @@ -53,9 +55,6 @@ export class ImportTracker implements IExtensionSingleActivationService {

private static sentMatches: Set<string> = new Set<string>();

// eslint-disable-next-line global-require
private hashFn = require('hash.js').sha256;

constructor(
@inject(IDocumentManager) private documentManager: IDocumentManager,
@inject(IDisposableRegistry) private disposables: IDisposableRegistry,
Expand Down Expand Up @@ -120,7 +119,7 @@ export class ImportTracker implements IExtensionSingleActivationService {
ImportTracker.sentMatches.add(packageName);
// Hash the package name so that we will never accidentally see a
// user's private package name.
const hash = this.hashFn().update(packageName).digest('hex');
const hash = createHash('sha256').update(packageName).digest('hex');
sendTelemetryEvent(EventName.HASHED_PACKAGE_NAME, undefined, { hashedName: hash });
}

Expand Down
Loading