diff --git a/package.json b/package.json index f5d7ada..b5e4987 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xtr-dev/rondevu-client", - "version": "0.8.1", + "version": "0.8.2", "description": "TypeScript client for Rondevu DNS-like WebRTC with username claiming and service discovery", "type": "module", "main": "dist/index.js", diff --git a/src/usernames.ts b/src/usernames.ts index 5a8bbd6..97d74a6 100644 --- a/src/usernames.ts +++ b/src/usernames.ts @@ -1,5 +1,11 @@ import * as ed25519 from '@noble/ed25519'; +// Set SHA-512 hash function for ed25519 (required in @noble/ed25519 v3+) +// Uses built-in WebCrypto API +ed25519.hashes.sha512Async = async (message: Uint8Array) => { + return new Uint8Array(await crypto.subtle.digest('SHA-512', message as BufferSource)); +}; + /** * Username claim result */