Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement coder module #925

Closed
TerryE opened this issue Jan 12, 2016 · 9 comments
Closed

Implement coder module #925

TerryE opened this issue Jan 12, 2016 · 9 comments
Assignees

Comments

@TerryE
Copy link
Collaborator

TerryE commented Jan 12, 2016

Implement coder module with methods:

  • toBase64
  • fromBase64
  • toHex
  • fromHex

Denormalise crypto to call the coder.toXXX routines. Discussion on #486 refers

@TerryE TerryE self-assigned this Jan 12, 2016
@marcelstoer
Copy link
Member

Denormalise crypto to call the coder.toXXX routines.

Not sure I understand.

Would that be the first time that two non-core modules actually depend on each other (see #386 (comment))? Why wouldn't you want to remove the methods in crypto? Calling the old crypto.xxx functions would still fail on a firmware that doesn't have the coder module, right?

@jmattsson
Copy link
Member

Hmm, that's a good point. I hadn't thought of that added complication for the backwards compatibiilty. Maybe that's enough to not do it and "fix it in documentation" instead? From a user perspective I'd still prefer backwards compatibility, but I definitely hear you on the technical difficulties.

Maybe we should start out with an

#if defined(LUA_USE_MODULES_CRYPTO) && !defined(LUA_USE_MODULES_CODER)
# define LUA_USE_MODULES_CODER
#endif

and then officially split them a bit later down the track when we feel we have time to maintain "stuff that has changed from version x to y that you need to be aware of" notes?

@marcelstoer
Copy link
Member

A software that is properly released usually has some deprecation policy based on a release plan in place. We don't have that and would have to rely on time-based deprecation. That would/could mean we create the new module, copy the methods and add a deprecation note to the docs for crypto. It could state that the deprecated methods are removed in n weeks or months.

@TerryE
Copy link
Collaborator Author

TerryE commented Jan 12, 2016

I can leave the old code in crypto with a #ifdef LUA_USE_MODULES_CODER option to substitute the the calls to coder instead. But I won't add any new methods to crypto.

@Alkorin
Copy link
Contributor

Alkorin commented Jan 18, 2016

encoding isn't a better name than coder ?
It's the name of golang's package for this kind of stuff

https://golang.org/pkg/encoding/hex/
https://golang.org/pkg/encoding/base64/

TerryE added a commit to TerryE/nodemcu-firmware that referenced this issue Feb 21, 2016
TerryE added a commit to TerryE/nodemcu-firmware that referenced this issue Feb 26, 2016
jmattsson pushed a commit that referenced this issue Feb 26, 2016
Addition of encoder module with base64 and hex encode/decode as per #925
@TerryE
Copy link
Collaborator Author

TerryE commented Mar 2, 2016

Done

@TerryE TerryE closed this as completed Mar 2, 2016
@devyte
Copy link

devyte commented Mar 3, 2016

@TerryE Thank you for this, I really want to get rid of the lua implementation of fromBase64() in my code.
@marcelstoer Is it possible to add the encoder module to the nodemcu firmware build service?

@marcelstoer
Copy link
Member

Yes, it is possible and sooner or later I will. There are a number of other modules that were merged into the dev branch recently which are not yet integrated into the cloud builder.

@jmattsson
Copy link
Member

One of these days we'll get a chance to rework how the whole module inclusion system works, and hopefully to something the cloud builder automatically picks up on.

@devsaurus devsaurus mentioned this issue Aug 8, 2016
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants