@xtr-dev/rondevu-client 0.8.2 → 0.8.3

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/usernames.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as ed25519 from '@noble/ed25519';
2
2
  // Set SHA-512 hash function for ed25519 (required in @noble/ed25519 v3+)
3
- // Uses built-in WebCrypto API
3
+ // Uses built-in WebCrypto API which only provides async digest
4
+ // We use the async ed25519 functions (signAsync, verifyAsync, getPublicKeyAsync)
4
5
  ed25519.hashes.sha512Async = async (message) => {
5
6
  return new Uint8Array(await crypto.subtle.digest('SHA-512', message));
6
7
  };
@@ -31,7 +32,7 @@ export class RondevuUsername {
31
32
  */
32
33
  async generateKeypair() {
33
34
  const privateKey = ed25519.utils.randomSecretKey();
34
- const publicKey = await ed25519.getPublicKey(privateKey);
35
+ const publicKey = await ed25519.getPublicKeyAsync(privateKey);
35
36
  return {
36
37
  publicKey: bytesToBase64(publicKey),
37
38
  privateKey: bytesToBase64(privateKey)
@@ -44,7 +45,7 @@ export class RondevuUsername {
44
45
  const privateKey = base64ToBytes(privateKeyBase64);
45
46
  const encoder = new TextEncoder();
46
47
  const messageBytes = encoder.encode(message);
47
- const signature = await ed25519.sign(messageBytes, privateKey);
48
+ const signature = await ed25519.signAsync(messageBytes, privateKey);
48
49
  return bytesToBase64(signature);
49
50
  }
50
51
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtr-dev/rondevu-client",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "TypeScript client for Rondevu DNS-like WebRTC with username claiming and service discovery",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",