@hive-p2p/browser 1.0.91 → 1.0.92

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": "@hive-p2p/browser",
3
- "version": "1.0.91",
3
+ "version": "1.0.92",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -60,7 +60,10 @@ export class Argon2Unified {
60
60
  };
61
61
  /** @param {string} pass @param {string | Uint8Array} salt @param {number} time @param {number} mem @param {number} parallelism @param {number} type @param {number} hashLen */
62
62
  #createArgon2Params(pass = "averylongpassword123456", salt = "saltsaltsaltsaltsalt", time = 1, mem = 2**10, parallelism = 1, type = 2, hashLen = 32) {
63
- const fixedSalt = salt.padEnd(16, '0').substring(0, 16); // 32 bytes minimum
63
+ const fixedSalt = IS_BROWSER
64
+ ? salt.padEnd(16, '0').substring(0, 16) //
65
+ : Buffer.from(fixedSalt); // 32 bytes minimum
66
+
64
67
  return {
65
68
  type, pass, parallelism,
66
69
  time, timeCost: time, // we preserve both for compatibility