Open naturallymitchell opened 5 years ago
for https://github.com/foundpatterns/lighttouch-base/issues/111#issuecomment-449542353 base64.to_string() and base64.from_string() ? //cc @Arnaz87
rename them from encode/decode to from_string/to_string?
let's see what Arnaud says first
Those names are consistent with the conventions yaml ans scl use, but in this case it's not very useful because both the input and the output are strings. I think here encoding and decoding are the winner terms.
Maybe to_base64 and from_base64, but I don't particularly like those aesthetically (because base64 is repeated and it's awkward to write and see... maybe), still vote for decode/encode
it has to be base64.whatever, right?
not to_base64 / from_base64, base64.from_string and base64.to_string
Not necessarily, it can be like the current lua library, a global to_base64 function. I still like encode more but this is much much better
which is much much better?
you like the current base64.encode / base64.decode ?
Yes, I like more base64.encode
because it's in it's own module, but just to_base64
is also a nice option and it's shorter to write, not my first choice because creates a global function when i'd prefer all functions in modules. base64.to_base64
is just ugly.
base64.to_base64
was never an option
it's either base64.from_string
, base64.encode
, or to_base64
https://github.com/foundpatterns/lighttouch-base/issues/111 depends on this
I very much dislike from/to_string, because both the output and input are strings so the names are very useless to distinguish between them, but decode and encode are pretty clear given the definitions of those words, I prefer those by far.
Are there anymore comments regarding the naming to base64 or can this be closed?
@dariusc93 which was your favorite syntax?
Encode/decode looks fine to me as it is implemented now.
cool
https://github.com/alicemaz/rust-base64