Grozz
Grozz

Reputation: 8435

How can I decode an encoded attachment using RIDE functions?

The attachment is Base58 encoded, but the only Base58 decode method in ride requires the input to be string. How to convert bytevector to string? When an account script is processing a transaction does it see the attachment sent as Base58 encoded of the real attachment or the real attachment?

Upvotes: 3

Views: 120

Answers (1)

Nazim Faour
Nazim Faour

Reputation: 804

RIDE doesn’t have a function that interprets byteVector as String, but only has functions toBase58String(byteVector) and toBase64String(byteVector) which decode a base58/64 encoded string to byteVector.

So in RIDE you can’t convert [72, 101, 108, 108, 111] to “Hello”, only to “9Ajdvzr” or to “base64:SGVsbG8=”. The attachment is handled as encoded base58/64.

Upvotes: 2

Related Questions