2

I analyze transactions with the InvocationTransaction type using the getplicationlog and get a data array in response

array(2) {
    ["type"]=> string(9) "ByteArray"
    ["value"]=> string(40) "0631901fb121f633fa496d3689649a06628f63c8"
}

Help me, how to convert ByteArray to an NEO address in PHP?

Юрий
  • 21
  • 2

1 Answers1

0

I'm not fully sure, but you can try to use convBase() function submitted by user in php.net. Usage is like:

echo 
  convBase(
   "0631901fb121f633fa496d3689649a06628f63c8", // hex data 
   "0123456789ABCDEF", // hex alphabet
   "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"); // base58 alphabet

Output:

61Gh7hAAzfnmUqVvE5najukwNBq

But I have some doubts that your hex data may be truncated or passed to some additional compression/encryption scheme, because typical NEO address when converted to base16 holds
25 bytes and you have only 20 bytes - so there must be something else going on

Agnius Vasiliauskas
  • 10,935
  • 5
  • 50
  • 70