Difference between revisions of "Kuey"

(Kuey)
 
Line 1: Line 1:
{{#set:LOVE Version=0.0.0}}
+
{{#set:LOVE Version=Any}}
 
{{#set:Description=Kuey is a library that encode/decode strings and files.}}
 
{{#set:Description=Kuey is a library that encode/decode strings and files.}}
  

Revision as of 11:02, 21 January 2016


That simple library encode and decode files with a key.

Example:

Kuey = require("Kuey")
local Encoded = Kuey.encode("Love is life!", "love2d") -- Encode the string with "love2d" as key
print(Encoded)                                         -- Show the encoded string
print(Kuey.decode(Encoded, "anykey"))                  -- Try to show a decoded string with any key
print(Kuey.decode(Encoded, "love2d"))                  -- Show the decoded string with the correct key

Output:

©Ìý╩R═▀ÅÔ╬   ÿ╔ì
Wps_ýT~!ic3P,
Love is life!

Available functions:

Kuey.encode(string, key) -- Return a string
Kuey.decode(string, key) -- Return a string
Kuey.encodeFile(filename, key[, outputname]) -- Return a string and write a file if outputname is defined.
Kuey.decodeFile(filename, key[, outputname]) -- Return a string and write a file if outputname is defined.

Forum post here!