This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TyDoesMC024's profile picture

Tys API (W.I.P) [Base64] [Logging]

Started by TyDoesMC024, 03 October 2016 - 03:48 PM
TyDoesMC024 #1
Posted 03 October 2016 - 05:48 PM
Tys API

Hello CC community, I am Ty. I am an average LUA programmer.

I love coding in LUA in my free time so I decided to start

a big project, An API.


Features

Base64 encode/decode

Logging (Prints text to the screen in a console style)


Coming soon

Reply, Give me some ideas to add.

I currently have some cool ideas




Documentation

SpoilerBasic usage:

api.log(name, type, text) --// Output: [NAME] [TYPE]: TEXT
api.encrypt(text) --// Base64 encode, saves results to settings API
api.decrypt(text) --// Base64 decode, saves results to settings API
settings.get("apiLastEncode") --// Results of the last encoding you made
settings.get("apiLastDecode") --// Results of the last decoding you made

Example program:

--[[ Encrypt ]]--
api.log("Base64 Encode","Info","Initializing")
sleep(1.5)
api.encrypt("Hello World!")
settings.get("apiLastEncode")
Edited on 04 October 2016 - 03:28 AM
Sewbacca #2
Posted 05 October 2016 - 06:24 PM
First, encrypting data is a really nice idea guy! =)
Maybe i am the only guy who have the courage to critic you,
but a lot people i know could say the same things and the thread is
open since 2 days (Don't take it personally if i'm wrong and you didn't read this thread).
Please don't get me wrong, i really don't want to affront you, but:
  1. It seems like you have to use api.<function name> in your code, not Base64.<function name>, what is actually the name of your API. Manny user use names to identify your API. 'api'. If someone call api,<—> it can be any API, but if they call Base64.<…>, then they know exactly what they are doing. That is one point, why maybe someone won't download this API.
  2. The settings API is a really nice API, for a program, not for an API. In some cases, settings are useful, but in this case, i would prefer to return the data. It is just more comfortable. That is another point, why maybe someone doesn't want your API. All the data of settings should be used to save information permanently like the version or allow startup for example.
Your API is a really good idea, but i think you have to improve the usage.
Also, you can look at this post, a tutorial for posting a program.
Please don't get me wrong, i really really don't want to affront you.
Sewbacca
Edited on 05 October 2016 - 04:25 PM
Anavrins #3
Posted 05 October 2016 - 11:42 PM
I'm gonna quote my post from your other thread since it applies here too.

Ok, thank you. I think it was Mimic (Online EMU)s problem. and as for Base64. I know its very easy to crack but I plan on making a SHA-512 hashing PHP script along side my Base64. The Base64 will encode the text and it will use the results (base64 encoded text) as a salt.
What do you mean it's easy to crack…, base64 isn't even an encryption function.
Base64 encodes raw bitstream into printable ascii character, used when you want to store binary data on a printable character-only medium.
A completely reversible encoding function that doesn't need any secret key.
Also, base64 is an extremely simple function to implement in Lua, I don't see why you would need to use http api for that…
If you want reference for the code, you can check out my implementation, http://pastebin.com/TEtna4tX
TyDoesMC024 #4
Posted 07 October 2016 - 07:54 PM
First, encrypting data is a really nice idea guy! =)
Maybe i am the only guy who have the courage to critic you,
but a lot people i know could say the same things and the thread is
open since 2 days (Don't take it personally if i'm wrong and you didn't read this thread).
Please don't get me wrong, i really don't want to affront you, but:
  1. It seems like you have to use api.<function name> in your code, not Base64.<function name>, what is actually the name of your API. Manny user use names to identify your API. 'api'. If someone call api,<—> it can be any API, but if they call Base64.<…>, then they know exactly what they are doing. That is one point, why maybe someone won't download this API.
  2. The settings API is a really nice API, for a program, not for an API. In some cases, settings are useful, but in this case, i would prefer to return the data. It is just more comfortable. That is another point, why maybe someone doesn't want your API. All the data of settings should be used to save information permanently like the version or allow startup for example.
Your API is a really good idea, but i think you have to improve the usage.
Also, you can look at this post, a tutorial for posting a program.
Please don't get me wrong, i really really don't want to affront you.
Sewbacca

Thank you. No worries :D/> I love all feedback. The reason I don't use base64.(function/var) is because its not the main focus of my api.
I am planning to rename it but… Im not that creative. so I am open to Ideas!


I'm gonna quote my post from your other thread since it applies here too.

Ok, thank you. I think it was Mimic (Online EMU)s problem. and as for Base64. I know its very easy to crack but I plan on making a SHA-512 hashing PHP script along side my Base64. The Base64 will encode the text and it will use the results (base64 encoded text) as a salt.
What do you mean it's easy to crack…, base64 isn't even an encryption function.
Base64 encodes raw bitstream into printable ascii character, used when you want to store binary data on a printable character-only medium.
A completely reversible encoding function that doesn't need any secret key.
Also, base64 is an extremely simple function to implement in Lua, I don't see why you would need to use http api for that…
If you want reference for the code, you can check out my implementation, http://pastebin.com/TEtna4tX

I didn't have time or a computer available to change the functions to encode. I will be updating in a bit.