@wishknish/knishio-client-js 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-js",
3
- "version": "0.7.8",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "productName": "Knish.IO Javascript SDK Client",
6
6
  "description": "JavaScript implementation of the Knish.IO SDK to consume Knish.IO GraphQL APIs.",
@@ -60,8 +60,9 @@ export function generateSecret (seed = null, length = 2048) {
60
60
  if (seed) {
61
61
  const sponge = new JsSHA('SHAKE256', 'TEXT')
62
62
  sponge.update(seed)
63
- // Fix: outputLen is in BITS, so for 'length' hex chars (length/2 bytes), we need length*2 bits
64
- return sponge.getHash('HEX', { outputLen: length * 2 })
63
+ // outputLen is in BITS. For `length` hex chars = length/2 bytes = length*4 bits.
64
+ // (length=2048 8192 bits 1024 bytes → 2048 hex chars, matching all SDKs.)
65
+ return sponge.getHash('HEX', { outputLen: length * 4 })
65
66
  } else {
66
67
  return randomString(length)
67
68
  }