Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bimedia-fr/machine-uuid
simple node module to generate a machine uuid
https://github.com/bimedia-fr/machine-uuid
Last synced: 8 days ago
JSON representation
simple node module to generate a machine uuid
- Host: GitHub
- URL: https://github.com/bimedia-fr/machine-uuid
- Owner: bimedia-fr
- License: apache-2.0
- Created: 2016-02-06T21:39:15.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-06-29T07:44:03.000Z (over 2 years ago)
- Last Synced: 2024-12-08T08:46:34.495Z (28 days ago)
- Language: JavaScript
- Size: 73.2 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# machine-uuid
simple node module to generate a machine uuid based on hardware available. (require node v4+)## installation
```sh
npm install bimedia-machine-uuid
```## usage
```js
var machine = require('machine-uuid')console.log(machine());
```
To keep id consistent between multiple calls or executions you must pass a `namespace` argument.
```js
var machine = require('machine-uuid')console.log(machine('mynamespace'));
// 2c433a07-140a-5bb9-949a-4997b566c397
console.log(machine('mynamespace'));
// 2c433a07-140a-5bb9-949a-4997b566c397
```Namespace may be a string (16 chars) or a uuid (v4):
```js
var machine = require('machine-uuid'),
uuidv4 = require('uuid/v4');var namespace = uuidv4();
console.log(machine(namespace));
// 2c433a07-140a-5bb9-949a-4997b566c397
console.log(machine(namespace));
// 2c433a07-140a-5bb9-949a-4997b566c397
```