vbakke / trytes

Converting between trytes and bytes
6 stars 1 forks source link

Converting back to the original form #3

Open vbakke opened 6 years ago

vbakke commented 6 years ago

Given the nature of this conversion, I think terms like asciiToTrytes and trytesToAscii will be confusing. Since they will not match perfectly both ways. (The square peg, round hole issue.)

Why do we convert?

We don't convert for fun. And I think we always want to convert back to the original form. For example, text message to trytes for the transaction, should be converted back to text. Iota seed that may need to be converted to bytes for AES encryption, but is of no use, unless it is converted back to the original seed.

Native

I suggest that we emphasis a native side, and an encoded/converted side. And that the function names emphasis this issue.

Good example is how @todofixthis renamed function to encode() and decode() in iota.lib.py.