@wishknish/knishio-client-ts 0.7.8 → 0.8.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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/libraries/crypto.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wishknish/knishio-client-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"productName": "Knish.IO TypeScript SDK Client",
|
|
5
5
|
"description": "TypeScript implementation of the Knish.IO SDK to consume Knish.IO GraphQL APIs with enhanced type safety.",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
package/src/libraries/crypto.ts
CHANGED
|
@@ -143,8 +143,9 @@ export function generateSecret(seed: string | null = null, length: number = CRYP
|
|
|
143
143
|
// Deterministic generation using SHAKE256 - MUST match JS SDK
|
|
144
144
|
const sponge = new JsSHA('SHAKE256', 'TEXT')
|
|
145
145
|
sponge.update(seed)
|
|
146
|
-
//
|
|
147
|
-
|
|
146
|
+
// outputLen is in BITS. For `length` hex chars = length/2 bytes = length*4 bits.
|
|
147
|
+
// (SECRET_LENGTH=2048 → 8192 bits → 1024 bytes → 2048 hex chars, matching all SDKs.)
|
|
148
|
+
return sponge.getHash('HEX', { outputLen: length * 4 }).toLowerCase()
|
|
148
149
|
} else {
|
|
149
150
|
// Cryptographically secure random generation
|
|
150
151
|
return randomString(length)
|