18 lines
454 B
JavaScript
18 lines
454 B
JavaScript
|
"use strict";
|
||
|
|
||
|
import systeminfo from 'systeminformation';
|
||
|
|
||
|
import hash from '../crypto/hash.mjs';
|
||
|
|
||
|
/**
|
||
|
* Returns what (should) be a reproducible UUID for each host that it runs on.
|
||
|
* @return {string}
|
||
|
*/
|
||
|
export default async function() {
|
||
|
let serial = (await systeminfo.system()).serial;
|
||
|
let uuid = await systeminfo.uuid();
|
||
|
return hash("sha256", "base64",
|
||
|
`${serial}@${uuid.os}@${uuid.hardware}@${uuid.macs.join("#")}`
|
||
|
).replace(/[+/=]/g, "");
|
||
|
}
|