Add Telemetry (#466)
* Telemetry v1 * Add package-lock.json to gitignore
This commit is contained in:
9
server/src/utils/anonymize.ts
Normal file
9
server/src/utils/anonymize.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import crypto from 'crypto';
|
||||
|
||||
export function anonymize(input) {
|
||||
if (process.env.IS_TELEMETRY_ANONYMIZATION_ENABLED === 'false') {
|
||||
return input;
|
||||
}
|
||||
// md5 shorter than sha-256 and collisions are not a security risk in this use-case
|
||||
return crypto.createHash('md5').update(input).digest('hex');
|
||||
}
|
||||
Reference in New Issue
Block a user