@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wishknish/knishio-client-ts",
3
- "version": "0.7.8",
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",
@@ -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
- // Fix: outputLen is in BITS, so for 1024 hex chars output, we need length*2 bits (matching JS SDK)
147
- return sponge.getHash('HEX', { outputLen: length * 2 }).toLowerCase()
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)