mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-10 02:43:25 +00:00
fix: initialize SHA-512 hash function for @noble/ed25519 v3
@noble/ed25519 v3.0.0 requires explicit SHA-512 hash function setup before using any cryptographic operations. This fixes the "hashes.sha512 not set" error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user