@threadbase-sh/streamer 1.59.1 → 1.61.0
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/dist/cli.cjs +152 -67
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -5589,7 +5589,12 @@ var PushRepository = class {
|
|
|
5589
5589
|
};
|
|
5590
5590
|
|
|
5591
5591
|
// src/server-identity.ts
|
|
5592
|
-
import {
|
|
5592
|
+
import {
|
|
5593
|
+
createHash as createHash2,
|
|
5594
|
+
createPrivateKey,
|
|
5595
|
+
createPublicKey,
|
|
5596
|
+
generateKeyPairSync
|
|
5597
|
+
} from "crypto";
|
|
5593
5598
|
import { chmodSync as chmodSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync7, renameSync as renameSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
5594
5599
|
import { homedir as homedir6 } from "os";
|
|
5595
5600
|
import { dirname as dirname6, join as join10 } from "path";
|
|
@@ -6680,11 +6685,11 @@ function joinStatCacheByNativePath(metas, canonicalStats) {
|
|
|
6680
6685
|
}
|
|
6681
6686
|
|
|
6682
6687
|
// src/utils/fileIdentity.ts
|
|
6683
|
-
import { createHash as
|
|
6688
|
+
import { createHash as createHash3 } from "crypto";
|
|
6684
6689
|
function fileIdentity(stat3, headBytes) {
|
|
6685
6690
|
if (stat3.ino && stat3.ino > 0) return `inode:${stat3.dev}:${stat3.ino}`;
|
|
6686
6691
|
const head = headBytes ?? Buffer.alloc(0);
|
|
6687
|
-
return `fp:${
|
|
6692
|
+
return `fp:${createHash3("sha1").update(head).digest("hex")}`;
|
|
6688
6693
|
}
|
|
6689
6694
|
function splitCompleteLines(buf, baseOffset) {
|
|
6690
6695
|
const spans = [];
|
|
@@ -8219,13 +8224,13 @@ function hashPrefix(text) {
|
|
|
8219
8224
|
}
|
|
8220
8225
|
|
|
8221
8226
|
// src/utils/conversationEtag.ts
|
|
8222
|
-
import { createHash as
|
|
8227
|
+
import { createHash as createHash4 } from "crypto";
|
|
8223
8228
|
function computeConversationEtag({
|
|
8224
8229
|
filePath,
|
|
8225
8230
|
messageCount,
|
|
8226
8231
|
timestamp: timestamp2
|
|
8227
8232
|
}) {
|
|
8228
|
-
const digest =
|
|
8233
|
+
const digest = createHash4("sha1").update(`${filePath}:${messageCount}:${timestamp2}`).digest("hex").slice(0, 16);
|
|
8229
8234
|
return `"${digest}"`;
|
|
8230
8235
|
}
|
|
8231
8236
|
|
|
@@ -11244,7 +11249,7 @@ var RuntimeStore = class _RuntimeStore {
|
|
|
11244
11249
|
import {
|
|
11245
11250
|
createCipheriv,
|
|
11246
11251
|
createDecipheriv,
|
|
11247
|
-
createHash as
|
|
11252
|
+
createHash as createHash5,
|
|
11248
11253
|
createPrivateKey as createPrivateKey2,
|
|
11249
11254
|
createPublicKey as createPublicKey2,
|
|
11250
11255
|
diffieHellman,
|
|
@@ -11295,7 +11300,7 @@ function publicKeyFromRaw(raw) {
|
|
|
11295
11300
|
}
|
|
11296
11301
|
}
|
|
11297
11302
|
function pskFromPairToken(token) {
|
|
11298
|
-
return
|
|
11303
|
+
return createHash5("sha256").update("threadbase-e2ee/1 psk", "utf-8").update(token, "utf-8").digest();
|
|
11299
11304
|
}
|
|
11300
11305
|
function chachaNonce(n) {
|
|
11301
11306
|
const nonce = Buffer.alloc(12);
|
|
@@ -11348,7 +11353,7 @@ var SymmetricState = class {
|
|
|
11348
11353
|
cipher = new CipherState();
|
|
11349
11354
|
constructor(protocolName) {
|
|
11350
11355
|
const name = Buffer.from(protocolName, "utf-8");
|
|
11351
|
-
this.h = name.length <= HASHLEN ? Buffer.concat([name, Buffer.alloc(HASHLEN - name.length)]) :
|
|
11356
|
+
this.h = name.length <= HASHLEN ? Buffer.concat([name, Buffer.alloc(HASHLEN - name.length)]) : createHash5("sha256").update(name).digest();
|
|
11352
11357
|
this.ck = Buffer.from(this.h);
|
|
11353
11358
|
this.cipher.initializeKey(null);
|
|
11354
11359
|
}
|
|
@@ -11371,7 +11376,7 @@ var SymmetricState = class {
|
|
|
11371
11376
|
this.cipher.initializeKey(tempK);
|
|
11372
11377
|
}
|
|
11373
11378
|
mixHash(data) {
|
|
11374
|
-
this.h =
|
|
11379
|
+
this.h = createHash5("sha256").update(this.h).update(data).digest();
|
|
11375
11380
|
}
|
|
11376
11381
|
/** Spec §5.2. Used only by the `psk` token. */
|
|
11377
11382
|
mixKeyAndHash(ikm) {
|
|
@@ -12880,7 +12885,7 @@ function createApiDeps(deps) {
|
|
|
12880
12885
|
}
|
|
12881
12886
|
|
|
12882
12887
|
// src/services/cache-integrity/cacheIntegrityMonitor.ts
|
|
12883
|
-
import { createHash as
|
|
12888
|
+
import { createHash as createHash6 } from "crypto";
|
|
12884
12889
|
import { existsSync as existsSync12 } from "fs";
|
|
12885
12890
|
|
|
12886
12891
|
// src/services/cache-integrity/alertStore.ts
|
|
@@ -12945,7 +12950,7 @@ function envInt(name, fallback) {
|
|
|
12945
12950
|
}
|
|
12946
12951
|
function fingerprintOf(ids) {
|
|
12947
12952
|
const sorted = [...ids].sort();
|
|
12948
|
-
return `sha256:${
|
|
12953
|
+
return `sha256:${createHash6("sha256").update(sorted.join("\n")).digest("hex")}`;
|
|
12949
12954
|
}
|
|
12950
12955
|
var CacheIntegrityMonitor = class {
|
|
12951
12956
|
constructor(cache, wsHub, log10, cacheDir, rescan, runDuringReset) {
|