From c5f4e61678df24da844f53cf0cea15c0e879c670 Mon Sep 17 00:00:00 2001 From: tripathyr Date: Sun, 15 Oct 2023 13:01:09 +0530 Subject: [PATCH] Update cloud.js --- src/cloud.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cloud.js b/src/cloud.js index f3b9041..db79b44 100644 --- a/src/cloud.js +++ b/src/cloud.js @@ -125,7 +125,11 @@ function proxyID(address) { bytes = ripemd160(Crypto.SHA256(Crypto.util.hexToBytes(address), { asBytes: true })); + } else if ((address.length == 42 && address.startsWith("0x")) || (address.length == 40 && !address.startsWith("0x"))){ //Ethereum Address + if (address.startsWith("0x")) { address = address.substring(2);} + bytes = Crypto.util.hexToBytes(address), { asBytes: true }; } + if (!bytes) throw "Invalid address: " + address; else { @@ -157,4 +161,4 @@ Object.defineProperties(cloud, { order: { get: () => kBucket.order } -}); \ No newline at end of file +});