We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 124875f commit 343af80Copy full SHA for 343af80
1 file changed
src/index.ts
@@ -69,14 +69,18 @@ function processGetAddrResponse(response: Buffer) {
69
partialResponse = partialResponse.slice(1 + PKLEN)
70
71
let hash: Buffer | undefined
72
+ let address: string;
73
+
74
if(PKLEN != ED25519_PK_SIZE) {
75
hash = Buffer.from(partialResponse.slice(0, 20))
- }
76
- //"advance" buffer
77
- partialResponse = partialResponse.slice(20)
78
-
79
- const address = Buffer.from(partialResponse.subarray(0, -2)).toString()
+ //"advance" buffer
+ partialResponse = partialResponse.slice(20)
+ address = Buffer.from(partialResponse.subarray(0, -2)).toString()
80
+ } else {
81
+ // ED25519: Convert raw bytes to hex string
82
+ address = partialResponse.subarray(0, -2).toString('hex');
83
+ }
84
85
return {
86
publicKey,
0 commit comments