{"id":15043851,"url":"https://github.com/andsmedeiros/hw-fingerprint","last_synced_at":"2025-04-15T00:28:46.498Z","repository":{"id":46290816,"uuid":"218640852","full_name":"andsmedeiros/hw-fingerprint","owner":"andsmedeiros","description":"Hardware-based fingerprinting for Node and Electron","archived":false,"fork":false,"pushed_at":"2023-09-22T15:15:43.000Z","size":25,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-30T03:46:24.253Z","etag":null,"topics":["authentication","digest","electronjs","fingerprint","hardware","nodejs","token"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andsmedeiros.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-10-30T22:51:51.000Z","updated_at":"2024-04-27T11:57:57.000Z","dependencies_parsed_at":"2023-12-27T00:22:41.822Z","dependency_job_id":"41cccfcf-34c6-4bbd-9a01-b56b15036553","html_url":"https://github.com/andsmedeiros/hw-fingerprint","commit_stats":{"total_commits":30,"total_committers":4,"mean_commits":7.5,"dds":0.4666666666666667,"last_synced_commit":"72fce90efe77d01f0cce6c48f7c8461927467999"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andsmedeiros%2Fhw-fingerprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andsmedeiros%2Fhw-fingerprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andsmedeiros%2Fhw-fingerprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andsmedeiros%2Fhw-fingerprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andsmedeiros","download_url":"https://codeload.github.com/andsmedeiros/hw-fingerprint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248983249,"owners_count":21193543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","digest","electronjs","fingerprint","hardware","nodejs","token"],"created_at":"2024-09-24T20:49:42.508Z","updated_at":"2025-04-15T00:28:46.482Z","avatar_url":"https://github.com/andsmedeiros.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hw-fingerprint\n\nHardware-based fingerprint for Node and Electron\n\n## About\n\nThis library provides a `getFingerprint()` function that produces a 512-bit signature based on the host machine's \nhardware information, suitable for use in Electron or Node client apps that require authentication against a server. \nThis signature is immutable as long as the underlying system is not changed, even across resets.\n\nIt uses information provided by [Node's OS module](https://nodejs.org/api/os.html) and [systeminformation](https://github.com/sebhildebrandt/systeminformation) library and has no other \ndependencies.\n\n\n## Fingerprinting info\n\nThe information used for fingerprinting is:\n\n- Operating system EOL (LF / CR+LF) and endianness (LE / BE)\n- Computer manufacturer, model, serial and UUID\n- BIOS vendor, version and release date\n- Motherboard manufacturer, model and serial\n- CPU manufacturer, brand, maximum speed, socket and number of cores and physical cores\n- Total memory\n- Platform and architecture\n- HDDs model and serial\n\nThe library exports a constant `FINGERPRINTING_INFO`. This is an object that contains the raw information available \nfor fingerprinting.\n\n\n## Usage\n\n`getFingerprint()` returns a [Node Buffer](https://nodejs.org/api/buffer.html) containing the 512-bit fingerprint. The returned buffer is internally \ncached, so the actual implementation gets called just once.\n\n```js\nimport { getFingerprint } from 'hw-fingerprint'\n\nconst fingerprint = getFingerprint() /* Buffer */\n```\n\nTo get the raw fingerprinting parameters, `import { FINGERPRINTING_INFO } from 'hw-fingerprint'`.\n\nIt is possible to filter on which parameters are actually used for fingerprint calculation:\n\n```js\nconst fingerprint = getFingerprint({ \n    only: [ /* ... */ ],  // If specified, **only** these parameters will be taken in account\n    except: [ /* ... */ ] // If specified, these parameters will **not** be taken in account\n})\n```\n\nThe available parameters' names are the same as `Object.keys(FINGERPRINTING_INFO)`:\n```js\n[ \n    'EOL', 'endianness', 'manufacturer', 'model', \n    'serial', 'uuid', 'vendor', 'biosVersion', \n    'releaseDate', 'boardManufacturer', 'boardModel', 'boardSerial', \n    'cpuManufacturer', 'brand', 'speedMax', 'cores', \n    'physicalCores', 'socket', 'memTotal', 'platform', \n    'arch', 'hdds' \n]\n```\n\nThis same list can be retrieved through the `FINGERPRINTING_PARAMETERS` constant export:\n```js\nimport { FINGERPRINTING_PARAMETERS } from 'hw-fingerprint'\n```\n\nEach combination of parameters will generate a different fingerprint. As long as the same set of parameters is always \nused, the fingerprint will always be the same, even if the order in which they are provided changes.\n\nEvery fingerprint generated gets cached internally, so calling `getFingerprint()` repeatedly with the same parameters\nis very cheap.\n\n## Upgrade v2.x -\u003e v3.x\n\nBack at v2.x, `getFingerprint()` was asynchronous, because the fingerprinting information depended on asynchronous \nfunctions. \n\nv3.x addresses this by raising the Node.js to a version that supports top-level `await`. This makes the \n`FINGERPRINTING_INFO` readily available in top-level and allows for synchronous fingerprinting. Despite this, the \n`getFingerprint()` function signature is backwards compatible and the `getFingerprintingInfo()` function is still \navailable.\n\nThe major breaking change in this release is dropping CJS in favour of ESM. \nTop-level await is only available in ES modules and I feel like it is necessary to push this boundary further already.\n\nAlso, fingerprinting parameter `endianess` (v2.x) was corrected to spell `endianness`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandsmedeiros%2Fhw-fingerprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandsmedeiros%2Fhw-fingerprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandsmedeiros%2Fhw-fingerprint/lists"}