si-hawk 0.0.0-stage → 1.1.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.
package/src/cli.js ADDED
@@ -0,0 +1,182 @@
1
+ #!/usr/bin/env node
2
+ import { detect, fingerprint, snapshot } from './index.js';
3
+ import { snapshotNode } from './node.js';
4
+ import { watchNode, watchScan } from './monitor.js';
5
+ import { scanNearby } from './scan.js';
6
+ import { createRequire } from 'node:module';
7
+ import { writeFile, appendFile } from 'node:fs/promises';
8
+ import { colorMode, jsonFileArgument, redactReport, renderHostSnapshot, renderScanReport } from './format.js';
9
+
10
+ const require = createRequire(import.meta.url);
11
+ const { version } = require('../package.json');
12
+
13
+ const rawArgs = process.argv.slice(2);
14
+ const subcommand = ['inv', 'evo', 'scan'].includes(rawArgs[0]) ? rawArgs[0] : null;
15
+ const args = subcommand ? rawArgs.slice(1) : rawArgs;
16
+ const invokedMode = process.env.HAWK_COMMAND;
17
+ const scanLabel = invokedMode === 'evo' || subcommand === 'evo' ? 'si-hawk evo' : 'si-hawk scan';
18
+ const hostCommand = invokedMode === 'inv' || subcommand === 'inv';
19
+ const scanCommand = invokedMode === 'evo' || subcommand === 'evo' || subcommand === 'scan' || args[0] === 'scan';
20
+ const helpRequested = args.includes('--help') || args.includes('-h');
21
+ const versionRequested = args.includes('--version') || args.includes('-v');
22
+ const flags = {
23
+ json: args.includes('--json'),
24
+ toml: args.includes('--toml'),
25
+ minimal: args.includes('--minimal'),
26
+ host: hostCommand || args.includes('--host'),
27
+ watch: args.includes('--watch'),
28
+ router: args.includes('--router'),
29
+ fingerprintOnly: args.includes('--fingerprint-only'),
30
+ nearby: args.includes('--nearby'),
31
+ };
32
+ const intervalIndex = args.indexOf('--interval');
33
+ const intervalSeconds = intervalIndex >= 0 ? Number(args[intervalIndex + 1]) : 30;
34
+ const sectionIndex = args.indexOf('--section');
35
+ const section = sectionIndex >= 0 ? args[sectionIndex + 1] : null;
36
+ const jsonFile = jsonFileArgument(args);
37
+ const full = args.includes('--full');
38
+ const redactionIndex = args.indexOf('--redact');
39
+ const redaction = redactionIndex >= 0 ? args[redactionIndex + 1] ?? '' : 'standard';
40
+ const color = colorMode({ noColor: args.includes('--no-color') });
41
+ const asciiRules = process.platform === 'win32' && !process.env.WT_SESSION;
42
+
43
+ function cell(value) {
44
+ if (value === null || value === undefined) return '—';
45
+ if (typeof value === 'object') return JSON.stringify(value);
46
+ return String(value).replace(/\r?\n/g, ' ');
47
+ }
48
+
49
+ function printRecords(rows, indent = 0) {
50
+ const columns = [...new Set(rows.flatMap(row => Object.keys(row)))];
51
+ if (!columns.length) return;
52
+ const values = rows.map(row => columns.map(key => cell(row[key])));
53
+ const widths = columns.map((key, i) => Math.max(key.length, ...values.map(row => row[i].length)));
54
+ const prefix = ' '.repeat(indent);
55
+ const line = row => prefix + row.map((value, i) => value.padEnd(widths[i])).join(' | ');
56
+ console.log(line(columns));
57
+ console.log(prefix + widths.map(width => '-'.repeat(width)).join('--+--'));
58
+ for (const row of values) console.log(line(row));
59
+ }
60
+
61
+ function printTable(obj, indent = 0) {
62
+ const prefix = ' '.repeat(indent);
63
+ for (const [key, value] of Object.entries(obj)) {
64
+ if (Array.isArray(value)) {
65
+ console.log(`${prefix}${key} (${value.length}):`);
66
+ if (!value.length) console.log(`${prefix} none reported`);
67
+ else if (value.every(item => item && typeof item === 'object' && !Array.isArray(item))) printRecords(value, indent + 1);
68
+ else console.log(`${prefix} ${value.map(cell).join(', ')}`);
69
+ } else if (value && typeof value === 'object') {
70
+ console.log(`${prefix}${key}:`);
71
+ printTable(value, indent + 1);
72
+ } else {
73
+ console.log(`${prefix}${key}: ${cell(value)}`);
74
+ }
75
+ }
76
+ }
77
+
78
+ function toTOML(obj, prefix = '') {
79
+ let out = '';
80
+ for (const [k, v] of Object.entries(obj)) {
81
+ const key = prefix ? `${prefix}.${k}` : k;
82
+ if (v && typeof v === 'object' && !Array.isArray(v)) out += toTOML(v, key);
83
+ else out += `${key} = ${JSON.stringify(v)}\n`;
84
+ }
85
+ return out;
86
+ }
87
+
88
+ async function runWatch(iterator) {
89
+ const controller = new AbortController();
90
+ const stop = () => controller.abort();
91
+ process.once('SIGINT', stop);
92
+ try {
93
+ if (jsonFile) await writeFile(jsonFile, '', { encoding: 'utf8', mode: 0o600 });
94
+ for await (const report of iterator(controller.signal)) {
95
+ if (flags.json || jsonFile) {
96
+ const publicReport = redactReport(report, { mode: redaction });
97
+ if (jsonFile) await appendFile(jsonFile, JSON.stringify(publicReport) + '\n', { encoding: 'utf8', mode: 0o600 });
98
+ else console.log(JSON.stringify(publicReport));
99
+ } else if (scanCommand) console.log(renderScanReport(redactReport(report, { mode: redaction }), { full, color, ascii: asciiRules, command: scanLabel }));
100
+ else console.log(renderHostSnapshot(redactReport(report, { mode: redaction }), { full, color, ascii: asciiRules }));
101
+ }
102
+ } finally { process.off('SIGINT', stop); }
103
+ }
104
+
105
+ if (helpRequested) {
106
+ console.log(`SI-Hawk device intelligence and system observer
107
+
108
+ Version: ${version}
109
+
110
+ Usage:
111
+ si-hawk inv [--section network|processes|services|hardware|device] [--full] [--json]
112
+ si-hawk evo [--full] [--json]
113
+ si-hawk scan [--full] [--json]
114
+ --nearby allows nearby radio observation in host watch mode.
115
+ --redact none|standard|strict controls identifiers in CLI reports (standard by default).
116
+ --json-file <path> saves JSON; --no-color disables ANSI color.
117
+
118
+ Compatibility aliases: hawk, hawk-inv, hawk-evo
119
+ `);
120
+ } else if (versionRequested) {
121
+ console.log(version);
122
+ } else if (sectionIndex >= 0 && !['network', 'processes', 'services', 'hardware', 'device'].includes(section)) {
123
+ console.error('--section requires network, processes, services, hardware, or device');
124
+ process.exitCode = 2;
125
+ } else if (section && !flags.host) {
126
+ console.error('--section is available with `si-hawk inv`');
127
+ process.exitCode = 2;
128
+ } else if (section && !['network', 'processes', 'services', 'hardware', 'device'].includes(section)) {
129
+ console.error('--section must be network, processes, services, hardware, or device');
130
+ process.exitCode = 2;
131
+ } else if (jsonFile === '') {
132
+ console.error('--json-file requires a file path');
133
+ process.exitCode = 2;
134
+ } else if (flags.json && jsonFile) {
135
+ console.error('Use either --json or --json-file, not both');
136
+ process.exitCode = 2;
137
+ } else if (!['none', 'standard', 'strict'].includes(redaction)) {
138
+ console.error('--redact requires none, standard, or strict');
139
+ process.exitCode = 2;
140
+ } else if (flags.watch && (!scanCommand && !flags.host || !Number.isFinite(intervalSeconds) || intervalSeconds < 1 || intervalSeconds > 3600)) {
141
+ console.error('--watch requires `si-hawk scan` or `--host`; --interval must be between 1 and 3600 seconds');
142
+ process.exitCode = 2;
143
+ } else if (scanCommand && flags.router) {
144
+ console.error('--router is not part of nearby scan paths');
145
+ process.exitCode = 2;
146
+ } else if (scanCommand && flags.watch) {
147
+ await runWatch(signal => watchScan({ intervalMs: intervalSeconds * 1000, signal }));
148
+ } else if (scanCommand) {
149
+ const report = await scanNearby();
150
+ const publicReport = redactReport(report, { mode: redaction });
151
+ if (flags.json) console.log(JSON.stringify(publicReport, null, 2));
152
+ else if (jsonFile) await writeFile(jsonFile, JSON.stringify(publicReport, null, 2) + '\n', { encoding: 'utf8', mode: 0o600 });
153
+ else console.log(renderScanReport(publicReport, { full, color, ascii: asciiRules, command: scanLabel }));
154
+ } else if (flags.host && flags.watch) {
155
+ await runWatch(signal => watchNode({ intervalMs: intervalSeconds * 1000, signal, includeRouter: flags.router, includeNearby: flags.nearby }));
156
+ } else {
157
+ const report = flags.host
158
+ ? await snapshotNode({ includeRouter: flags.router })
159
+ : flags.minimal
160
+ ? { fingerprint: fingerprint().hash, os: detect().os, browser: detect().browser, device: detect().device }
161
+ : snapshot();
162
+
163
+ const publicReport = redactReport(report, { mode: redaction });
164
+ if (flags.fingerprintOnly) {
165
+ const fpHash = typeof report.fingerprint === 'string' ? report.fingerprint : report.fingerprint?.hash;
166
+ if (!fpHash) {
167
+ console.error('--fingerprint-only is unavailable with --host');
168
+ process.exitCode = 2;
169
+ } else console.log(fpHash);
170
+ } else if (flags.json) {
171
+ console.log(JSON.stringify(publicReport, null, 2));
172
+ } else if (jsonFile) {
173
+ await writeFile(jsonFile, JSON.stringify(publicReport, null, 2) + '\n', { encoding: 'utf8', mode: 0o600 });
174
+ } else if (flags.toml) {
175
+ console.log(toTOML(publicReport));
176
+ } else {
177
+ if (flags.host) console.log(renderHostSnapshot(publicReport, { section, full, color, ascii: asciiRules }));
178
+ else printTable(publicReport);
179
+ }
180
+ }
181
+
182
+
package/src/detect.js ADDED
@@ -0,0 +1,165 @@
1
+ import { tryFn } from './util.js';
2
+
3
+ /**
4
+ * Browser detection rules. Order matters: more specific browsers
5
+ * (Edge, Opera, Samsung Internet) must be checked before Chrome
6
+ * and Safari, because their user-agent strings also contain
7
+ * "Chrome" and "Safari" tokens.
8
+ */
9
+ const BROWSERS = [
10
+ // Edge — also matches EdgiOS and EdgA (sub-string "Edg" is present in all)
11
+ { name: 'Edge', re: /Edg(?:e|A|iOS)?\/(\d[\d.]*)/ },
12
+ // Opera (desktop OPR/ and legacy Opera Mini)
13
+ { name: 'Opera', re: /(?:OPR|Opera Mini|Opera)\/(\d[\d.]*)/ },
14
+ { name: 'Samsung Internet', re: /SamsungBrowser\/(\d[\d.]*)/ },
15
+ // Chrome — also matches CriOS (Chrome on iOS)
16
+ { name: 'Chrome', re: /(?:Chrome|CriOS)\/(\d[\d.]*)/ },
17
+ // Safari — Version/X.Y ... Safari (desktop and iOS Safari)
18
+ { name: 'Safari', re: /Version\/(\d[\d.]*).*Safari/ },
19
+ { name: 'Firefox', re: /(?:Firefox|FxiOS)\/(\d[\d.]*)/ },
20
+ ];
21
+
22
+ const ENGINES = {
23
+ blink: /Chrome|Chromium|Edg|OPR|SamsungBrowser/,
24
+ webkit: /AppleWebKit/,
25
+ gecko: /Gecko/,
26
+ presto: /Presto/,
27
+ };
28
+
29
+ const OS_PATTERNS = [
30
+ // Windows Phone must be checked before Android because the Lumia UA
31
+ // contains both "Windows Phone" and "Android".
32
+ { name: 'windows-phone', re: /Windows Phone/ },
33
+ { name: 'windows', re: /Windows NT/ },
34
+ { name: 'android', re: /Android/ },
35
+ { name: 'ios', re: /iPhone|iPad|iPod/ },
36
+ { name: 'macos', re: /Mac OS X/ },
37
+ { name: 'chromeos', re: /CrOS/ },
38
+ { name: 'linux', re: /Linux/ },
39
+ ];
40
+
41
+ const BRANDS = [
42
+ { name: 'Apple', re: /\bApple\b/i, modelRe: /iPhone|iPad|Macintosh|Mac OS X/ },
43
+ { name: 'Samsung', re: /Samsung/i },
44
+ { name: 'Huawei', re: /Huawei|HONOR/i },
45
+ { name: 'Xiaomi', re: /Xiaomi|Mi\s|Redmi/i },
46
+ { name: 'OnePlus', re: /OnePlus/i },
47
+ { name: 'Google', re: /Pixel/i },
48
+ { name: 'Microsoft', re: /Windows Phone/i },
49
+ ];
50
+
51
+ /** Extract a normalized OS version string from a user-agent. */
52
+ function extractOsVersion(ua, os) {
53
+ const patterns = {
54
+ windows: /Windows NT\s+([\d.]+)/,
55
+ 'windows-phone': /Windows Phone\s+([\d.]+)/,
56
+ android: /Android\s+([\d.]+)/,
57
+ ios: /\bOS\s+([\d_]+)/,
58
+ macos: /Mac OS X\s+([\d_]+)/,
59
+ chromeos: /CrOS\s+\S+\s+([\d.]+)/,
60
+ };
61
+ const re = patterns[os];
62
+ if (!re) return null;
63
+ const m = re.exec(ua);
64
+ return m ? m[1].replace(/_/g, '.') : null;
65
+ }
66
+
67
+ /** Extract a device model from the first non-engine parenthetical group. */
68
+ function extractModel(ua) {
69
+ const parenMatch = ua.match(/\(([^)]+)\)/g);
70
+ if (!parenMatch) return null;
71
+ const skipKeywords = ['android', 'linux', 'windows', 'macintosh', 'intel', 'x11', 'cros', 'cpu', 'symbos', 's60', 'midp', 'j2me', 'like mac os', 'compatible', 'mobile', 'tablet', 'x64', 'x86', 'win64', 'win32', 'arm64', 'armhf', 'aarch64'];
72
+ for (const group of parenMatch) {
73
+ const content = group.slice(1, -1);
74
+ // Skip groups that are engine/compat tokens, e.g. "(KHTML, like Gecko)".
75
+ if (/like Gecko|KHTML/i.test(content)) continue;
76
+ const parts = content.split(';').map(s => s.trim()).filter(s => s.length > 0);
77
+ // Filter out OS/system info parts, version paths, locale tokens, and
78
+ // architecture/build tokens.
79
+ const deviceParts = parts.filter(p => {
80
+ const lower = p.toLowerCase();
81
+ return !skipKeywords.some(kw => lower.includes(kw)) && p.length > 2 && !p.includes('/') && !p.includes(':');
82
+ });
83
+ if (deviceParts.length > 0) {
84
+ return deviceParts[deviceParts.length - 1] || null;
85
+ }
86
+ }
87
+ return null;
88
+ }
89
+
90
+ export function parseUserAgent(ua) {
91
+ if (!ua || typeof ua !== 'string') {
92
+ return {
93
+ browser: 'unknown',
94
+ version: null,
95
+ engine: 'unknown',
96
+ os: 'unknown',
97
+ osVersion: null,
98
+ device: 'unknown',
99
+ brand: 'unknown',
100
+ model: null,
101
+ type: 'desktop',
102
+ bot: false,
103
+ };
104
+ }
105
+
106
+ let browser = 'unknown', version = null;
107
+ for (const b of BROWSERS) {
108
+ const m = b.re.exec(ua);
109
+ if (m) { browser = b.name; version = m[1] || null; break; }
110
+ }
111
+
112
+ let engine = 'unknown';
113
+ for (const [k, v] of Object.entries(ENGINES)) {
114
+ if (v.test(ua)) { engine = k; break; }
115
+ }
116
+
117
+ let os = 'unknown';
118
+ for (const o of OS_PATTERNS) {
119
+ if (o.re.test(ua)) { os = o.name; break; }
120
+ }
121
+ const osVersion = extractOsVersion(ua, os);
122
+
123
+ let bot = /bot|crawler|spider|googlebot|bingbot|curl|wget|headless/i.test(ua);
124
+ let type = 'desktop';
125
+ if (bot) type = 'bot';
126
+ else if (/iPad|Tablet|SM-T|Kindle/i.test(ua) || (os === 'android' && !/Mobile/i.test(ua))) type = 'tablet';
127
+ else if (/Mobile|iPhone|iPod|Android.*Mobile|Opera Mini/i.test(ua)) type = 'mobile';
128
+
129
+ let brand = 'unknown', model = null;
130
+ for (const b of BRANDS) {
131
+ const re = b.modelRe ? new RegExp(b.re.source + '|' + b.modelRe.source, 'i') : b.re;
132
+ if (re.test(ua)) { brand = b.name; break; }
133
+ }
134
+
135
+ model = extractModel(ua);
136
+
137
+ return { browser, version, engine, os, osVersion, device: model || 'unknown', brand, model, type, bot };
138
+ }
139
+
140
+ export function detectDevice(env = globalThis) {
141
+ env = env || {};
142
+ const nav = tryFn(() => env.navigator || {}, {});
143
+ const win = tryFn(() => env.window || env || {}, env || {});
144
+ const doc = tryFn(() => env.document || {}, {});
145
+
146
+ const language = tryFn(() => nav.language ?? null, null);
147
+ const languages = tryFn(() => Array.isArray(nav.languages) ? nav.languages : null, null);
148
+ const onLine = tryFn(() => nav.onLine ?? null, null);
149
+ const cookieEnabled = tryFn(() => nav.cookieEnabled ?? null, null);
150
+ const hardwareConcurrency = tryFn(() => nav.hardwareConcurrency ?? null, null);
151
+ const deviceMemory = tryFn(() => nav.deviceMemory ?? null, null);
152
+ const maxTouchPoints = tryFn(() => nav.maxTouchPoints ?? 0, 0);
153
+ const pointerEnabled = tryFn(() => nav.pointerEnabled || (win.matchMedia && win.matchMedia('(pointer: fine)').matches), false);
154
+
155
+ return {
156
+ language,
157
+ languages,
158
+ onLine,
159
+ cookieEnabled,
160
+ hardwareConcurrency,
161
+ deviceMemory,
162
+ maxTouchPoints,
163
+ pointerEnabled,
164
+ };
165
+ }
package/src/evo.js ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ process.env.HAWK_COMMAND = 'evo';
3
+ await import('./cli.js');
@@ -0,0 +1,122 @@
1
+ import { tryFn } from './util.js';
2
+
3
+ /**
4
+ * djb2 string hash. Produces an 8-character zero-padded lowercase hex string.
5
+ *
6
+ * @param {string} str The string to hash.
7
+ * @param {number} seed Optional initial value (default 5381).
8
+ * @returns {string} 8-char hex hash.
9
+ */
10
+ export function djb2(str, seed = 5381) {
11
+ let h = seed >>> 0;
12
+ for (let i = 0; i < str.length; i++) {
13
+ h = ((h << 5) + h + str.charCodeAt(i)) >>> 0;
14
+ }
15
+ return (h >>> 0).toString(16).padStart(8, '0');
16
+ }
17
+
18
+ /**
19
+ * Produce a 24-character hex hash from a combined string by running
20
+ * djb2 with three different seeds. Every input byte influences all
21
+ * three rounds, so every fingerprint component contributes to the
22
+ * final identity.
23
+ *
24
+ * @param {string} combined Concatenated component hashes.
25
+ * @returns {string} 24-char hex hash.
26
+ */
27
+ function hash24(combined) {
28
+ return djb2(combined, 5381) + djb2(combined, 13131) + djb2(combined, 4242);
29
+ }
30
+
31
+ function canvasSignature(env = globalThis) {
32
+ return tryFn(() => {
33
+ const canvas = env.document.createElement('canvas');
34
+ canvas.width = 200; canvas.height = 50;
35
+ const ctx = canvas.getContext('2d');
36
+ ctx.textBaseline = 'top';
37
+ ctx.font = '14px Arial';
38
+ ctx.fillStyle = '#f60';
39
+ ctx.fillRect(0, 0, 200, 50);
40
+ ctx.fillStyle = '#069';
41
+ ctx.fillText('Hawk fingerprint', 2, 15);
42
+ ctx.fillStyle = 'rgba(102, 204, 0, 0.7)';
43
+ ctx.fillText('Hawk fingerprint', 4, 17);
44
+ return canvas.toDataURL();
45
+ }, null);
46
+ }
47
+
48
+ function webglSignature(env = globalThis) {
49
+ return tryFn(() => {
50
+ const canvas = env.document.createElement('canvas');
51
+ const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
52
+ if (!gl) return null;
53
+ const debug = gl.getExtension('WEBGL_debug_renderer_info');
54
+ const vendor = debug ? gl.getParameter(debug.UNMASKED_VENDOR_WEBGL) : gl.getParameter(gl.VENDOR);
55
+ const renderer = debug ? gl.getParameter(debug.UNMASKED_RENDERER_WEBGL) : gl.getParameter(gl.RENDERER);
56
+ return vendor + '~' + renderer;
57
+ }, null);
58
+ }
59
+
60
+ function audioSignature(env = globalThis) {
61
+ return tryFn(() => {
62
+ const AudioContext = env.AudioContext || env.webkitAudioContext;
63
+ if (!AudioContext) return null;
64
+ const ctx = new AudioContext();
65
+ const result = ctx.sampleRate + '~' + (ctx.destination?.maxChannelCount || 2);
66
+ // Best-effort close to avoid resource leaks; close() returns a Promise
67
+ // but we do not need to await it for fingerprint generation.
68
+ tryFn(() => ctx.close?.(), null);
69
+ return result;
70
+ }, null);
71
+ }
72
+
73
+ function fontSignature(env = globalThis) {
74
+ const doc = env.document;
75
+ if (!doc || !doc.body) return 'no-dom';
76
+ const span = doc.createElement('span');
77
+ span.innerText = 'mmmmmmmmmmlli';
78
+ span.style.fontSize = '72px';
79
+ span.style.position = 'absolute';
80
+ span.style.left = '-9999px';
81
+ doc.body.appendChild(span);
82
+ try {
83
+ return span.offsetWidth;
84
+ } finally {
85
+ doc.body.removeChild(span);
86
+ }
87
+ }
88
+
89
+ export function generateFingerprint(env = globalThis) {
90
+ env = env || {};
91
+ const nav = tryFn(() => env.navigator || {}, {});
92
+ const screen = tryFn(() => env.screen || {}, {});
93
+ const win = tryFn(() => env.window || env || {}, env || {});
94
+
95
+ const ua = tryFn(() => nav.userAgent || 'unknown', 'unknown');
96
+ const tz = tryFn(() => Intl.DateTimeFormat().resolvedOptions().timeZone, 'unknown');
97
+ const lang = tryFn(() => nav.language || 'unknown', 'unknown');
98
+ const plat = tryFn(() => nav.platform || 'unknown', 'unknown');
99
+ const cores = tryFn(() => nav.hardwareConcurrency || 0, 0);
100
+ const mem = tryFn(() => nav.deviceMemory || 0, 0);
101
+
102
+ const screenSig = tryFn(() => `${screen.width}x${screen.height}x${screen.colorDepth}x${win.devicePixelRatio}`, '0x0x0x0');
103
+
104
+ const components = {
105
+ userAgent: djb2(ua),
106
+ screen: djb2(screenSig),
107
+ timezone: djb2(tz),
108
+ language: djb2(lang),
109
+ platform: djb2(plat),
110
+ cpuCores: djb2(String(cores)),
111
+ deviceMemory: djb2(String(mem)),
112
+ canvas: djb2(canvasSignature(env) || ''),
113
+ webgl: djb2(webglSignature(env) || ''),
114
+ audio: djb2(audioSignature(env) || ''),
115
+ fonts: djb2(String(tryFn(() => fontSignature(env), null))),
116
+ };
117
+
118
+ // Combine ALL component hashes into the final 24-char identity.
119
+ const combined = Object.values(components).join('');
120
+ const hash = hash24(combined);
121
+ return { hash, components };
122
+ }