Gathering detailed insights and metrics for node-machine-id-xz
Gathering detailed insights and metrics for node-machine-id-xz
npm install node-machine-id-xz
Typescript
Module System
Node Version
NPM Version
68.2
Supply Chain
93.3
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
6,566
Last Day
1
Last Week
13
Last Month
64
Last Year
1,408
594 Stars
63 Commits
62 Forks
7 Watching
2 Branches
9 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.2
Package Id
node-machine-id-xz@1.0.2
Unpacked Size
35.29 kB
Size
12.86 kB
File Count
12
NPM Version
6.14.11
Node Version
14.16.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
225%
13
Compared to previous week
Last month
77.8%
64
Compared to previous month
Last year
-49.6%
1,408
Compared to previous year
35
Cross-platform unique machine (desktop) id discovery
Module based on OS native UUID/GUID which used for internal needs.
All others approaches requires elevated rights or much depends on hardware components, but this approach summarize the methods of selecting the most reliable unique identifier
MachineGuid
in registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography
(can be changed by administrator but with unpredictable consequences)It is generated during OS installation and won't change unless you make another OS updates or reinstall. Depending on the OS version it may contain the network adapter MAC address embedded (plus some other numbers, including random), or a pseudorandom number.
IOPlatformUUID
(the same Hardware UUID)
ioreg -rd1 -c IOPlatformExpertDevice
Value from I/O Kit registry in IOPlatformExpertDevice class
/var/lib/dbus/machine-id
(can be changed by root
but with unpredictable consequences)
http://man7.org/linux/man-pages/man5/machine-id.5.htmlThe /var/lib/dbus/machine-id file contains the unique machine ID of the local system that is set during installation. The machine ID is a single newline-terminated, hexadecimal, 32-character, lowercase machine ID string. When decoded from hexadecimal, this corresponds with a 16-byte/128-bit string.
The machine ID is usually generated from a random source during system installation and stays constant for all subsequent boots. Optionally, for stateless systems, it is generated during runtime at early boot if it is found to be empty.
The machine ID does not change based on user configuration or when hardware is replaced.
npm install node-machine-id
<Boolean>
, If true
return original value of machine id, otherwise return hashed value (sha-256), default: false
machineId
1import {machineId, machineIdSync} from 'node-machine-id'; 2 3// Asyncronous call with async/await or Promise 4 5async function getMachineId() { 6 let id = await machineId(); 7 ... 8} 9 10machineId().then((id) => { 11 ... 12}) 13 14// Syncronous call 15 16let id = machineIdSync() 17// id = c24b0fe51856497eebb6a2bfcd120247aac0d6334d670bb92e09a00ce8169365 18let id = machineIdSync(true) 19// id = 98912984-c4e9-5ceb-8000-03882a0485e4
machine-id
As a workaround you can generate new machine-ids for each instance (or container) with
dbus-uuidgen
and changed them in the respective > files:/etc/machine-id
and/var/lib/dbus/machine-id
. Thanks @stefanhuber
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 7/24 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More