Jump to content




API: Letter to Binary Converter

api computer pocket

5 replies to this topic

#1 DaKodiMaster

  • Members
  • 7 posts

Posted 03 April 2015 - 02:58 PM

Note: This project is now discontinued.

Edited by DaKodiMaster, 25 May 2016 - 01:32 AM.


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 03 April 2015 - 03:07 PM

You might be better off using string.byte and a number-to-binary-representation-string converter. You could probably shorten this down to a dozen lines, likely less.

#3 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 03 April 2015 - 07:18 PM

If you want to write something like that, take a look at my API http://pastebin.com/qPaeUQRa
For you, only binaryToNumber and numberToBinary will be interesting I think, the other stuff is just some binary logic stuff.

Also my API got a problem when you try to do logic on strings with an un-equal length, because it will fill the shorter string up with "0000000" until they are the same length.

(here is a compressed version of it http://pastebin.com/iwtWn6yG the file size is only reduced by roughly 50%.)

Edited by Freack100, 03 April 2015 - 07:24 PM.


#4 Anavrins

  • Members
  • 775 posts

Posted 03 April 2015 - 07:49 PM

View PostDaKodiMaster, on 03 April 2015 - 02:58 PM, said:

...
Wow, this has no uses for bit operations, I first thought it would return a table such as {1,0,0,0,0,0,1}
but it literally print() "A = Binary: 01000001"

#5 DaKodiMaster

  • Members
  • 7 posts

Posted 29 December 2015 - 02:04 PM

I'm working on another version of this, it will return a table such as: {0,0,1,1,0,0,0,0} for 0 rather than a string.

#6 Pyuu

  • Members
  • 203 posts

Posted 31 December 2015 - 07:16 PM

No support for squiggly (or as nerds say: "tilde"), I'm sad.
Also, instead of making a table with binary conversions, I recommend this way:

Spoiler






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users