Ascii94

  • mniip
    26th Jun 2012 Developer 3 Permalink
    Im not sure whether is it correct to post this topic there, since it's not very related to TPT

    So, for those who know Lua as a programming language, and not as a-thing-to-make-tpt-mods:

    Recently ive invented new encoding system which turns binary data into text, which can be sent without any worry that binarity will be lost, like any other text, like. many protocols dont like the \0 character and etc

    This is very similar to Ascii85, but is more compact, it stores 9 bytes in 11, with a 22% data expansion, while Ascii85 does 25%

    Here is the script:
    http://pastebin.com/YZ7xGydn

    If you didnt stop reading this at paragraph 2 (:P) , you know what to do to it
    str2a94 takes a binary string and returns textual
    a942str takes a textual string and returns binary

    This is also a very cool way of encrypting messages:
    }-4VC5`nL1G3'P1(!

    EDIT: it took out all line breaks D:
  • mniip
    27th Jun 2012 Developer 2 Permalink
    So, i have to assume there are nobody "who know Lua as a programming language, and not as a-thing-to-make-tpt-mods"
  • coolcat99
    27th Jun 2012 Member 0 Permalink
    Looks intresting.
    Shame I have no idea how to use it.
  • boxmein
    27th Jun 2012 Former Staff 0 Permalink
    @coolcat99 (View Post)
    1. Create file "ascii94.lua"
    2. Open Lua console either in-game or separately in your computer
    3. dofile("ascii94.lua")
    4. tpt.log(str2a94("Hello world"))
    5. => 7HIu#5Zq(3HOv#!

    @mniip (View Post)
    tpt.log(a942str("}-4VC5`nL1G3'P1(!"))
    => Hello, world!

    It's awesome, man! The encoded values differ even when most of the bytes are the same..
  • mniip
    27th Jun 2012 Developer 0 Permalink
    it's Actually designed to encode binary files into printable string