How to use the node-machine-id.machineId function in node-machine-id

To help you get started, we’ve selected a few node-machine-id examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github realm / realm-js / lib / submit-analytics.js View on Github external
setTimeout(() => {
            if (isAnalyticsDisabled()) {
                return;
            }

            machineId()
                .catch() // Ignore errors
                .then((identifier) => {
                    if (!identifier) {
                        identifier = sha256('unknown');
                    }

                    const payload = {
                        'event': eventName,
                        'properties': {
                            'token': 'aab85907a13e1ff44a95be539d9942a9',
                            'distinct_id': identifier,
                            'Anonymized Machine Identifier': identifier,
                            'Anonymized Application ID': sha256(__dirname),
                            'Binding': context || 'node.js',
                            'Version': require('../package.json').version,
                            'Language': 'javascript',
github HelloWorld017 / Nexodus / src / utils / UserStore.js View on Github external
async init() {
		try {
			const uuid = await machineId();

			this.derivedHash = await new Promise((resolve, reject) => {
				crypto.pbkdf2(this.keyString, uuid, 103782, 32, 'sha512', (err, derivedKey) => {
					if(err) return reject(err);

					resolve(derivedKey);
				});
			});

			this.storeInitiated = true;
		} catch(e) {
			this.launcher.nexodus.logError(e);
		}

		try {
			const configDir = path.dirname(this.configPath);
github akaJes / marlin-config / app / server.js View on Github external
app.get('/version/:screen', function (req, res) {
  machineId()
  .then(id =>
    visitor.screenview({
      cd:req.params.screen,
      an:pjson.name+(isElectron&&"-electron"||''),
      av:pjson.version,
      ua:req.headers['user-agent'],
      cid: id,
      ul:req.headers['accept-language'].split(',')[0],
    }).send()
  )
  Promise.all([
    pio.isPIO().catch(() => false),
    git.root(),
    pioRoot().then(pioEnv).catch(e => []),
    st.read(),
  ])
github dgreif / ring / api / util.ts View on Github external
export async function getHardwareId() {
  const id = await machineId()
  return generateUuid(id)
}
github smartive / kuby / src / utils / crypto.ts View on Github external
private static async getKey(): Promise {
    const machineKey = await machineId();
    return createHmac(hash, machineKey)
      .update(machineKey)
      .digest();
  }
}
github segmentio / typewriter / src / cli / index.tsx View on Github external
async function getAnonymousId() {
	return await machineId(false)
}

node-machine-id

Unique machine (desktop) id (no admin privileges required).

MIT
Latest version published 5 years ago

Package Health Score

67 / 100
Full package analysis