@lingyao037/openclaw-lingyao-cli 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.mjs +3 -8
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -17,6 +17,7 @@ import { join, dirname } from 'path';
17
17
  import { fileURLToPath } from 'url';
18
18
  import https from 'https';
19
19
  import os from 'os';
20
+ import { createHash } from 'crypto';
20
21
  import QRCode from 'qrcode';
21
22
 
22
23
  const __filename = fileURLToPath(import.meta.url);
@@ -51,14 +52,8 @@ function getMachineId() {
51
52
  if (macs.length > 0) {
52
53
  macs.sort();
53
54
  const macStr = macs.join('');
54
- // fallback to simple hash since we can't use top level await here easily in older nodes
55
- let hash = 0;
56
- for (let i = 0; i < macStr.length; i++) {
57
- const char = macStr.charCodeAt(i);
58
- hash = ((hash << 5) - hash) + char;
59
- hash = hash & hash;
60
- }
61
- return Math.abs(hash).toString(36).substring(0, 8);
55
+ // MD5 哈希,与 orchestrator.ts 保持一致
56
+ return createHash('md5').update(macStr).digest('hex').substring(0, 8);
62
57
  }
63
58
  } catch (e) {
64
59
  // ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingyao037/openclaw-lingyao-cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Lingyao Channel Plugin for OpenClaw - bidirectional sync via lingyao.live server relay",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",