Closed vbakke closed 6 years ago
You're correct. Encoding trytes to bytes, gives you bytes within the range of 0-242.
However, when encrypting the bytes, you get bytes in the whole range of 0-255. Therefore, you cannot decode "tryte bytes", since they are no longer just that.
I will create a new set of function that will encode full bytes into tryte strings that you can use.
The
decodeTryteStringFromBytes()
fails converting my bytes into trytes.I have encoded the tryte 'A9Z' to [1, 78, 255], and encrypted it to [22, 249, 151].
Calling
decodeTryteStringFromBytes([22, 249, 151])
returns "V9". CallingencodeTryteStringAsBytes("V9")
returns [22, 0, 254].