Difference between revisions of "bitser"

(Created page with "bitser is a serialization library for LuaJIT. It's very fast, produces tiny output and safely handles untrusted input. <source lang="lua">local bitser = require 'bitser' bit...")
 
m (Fixed github link)
Line 12: Line 12:
 
someValue = bitser.loadData(serializedData:getPointer(), serializedData:getSize())</source>
 
someValue = bitser.loadData(serializedData:getPointer(), serializedData:getSize())</source>
  
Get bitser from its [http://github.com/gvx/Ser GitHub repositiory].
+
Get bitser from its [http://github.com/gvx/bitser GitHub repositiory].
  
 
{{#set:LOVE Version=Any}}
 
{{#set:LOVE Version=Any}}

Revision as of 17:32, 17 February 2016

bitser is a serialization library for LuaJIT. It's very fast, produces tiny output and safely handles untrusted input.

local bitser = require 'bitser'

bitser.register('someResource', someResource)
bitser.registerClass(SomeClass)

serializedString = bitser.dumps(someValue)
someValue = bitser.loads(serializedString)
love.filesystem.write("filename", serializedString)
serializedData = love.filesystem.newFileData("filename")
someValue = bitser.loadData(serializedData:getPointer(), serializedData:getSize())

Get bitser from its GitHub repositiory.