bin/BinRewrite.md
2017-08-03 00:22:47 -04:00

121 lines
4.0 KiB
Markdown

# Bin Rewrite Progress!
My vision for the bin library is to provide great and consistant support for binary minipulation... The old version was not consistant with how I wanted things to work. Great things to come!
**Note: A lot breaks (Almost everything)**
Progress: [=====- - - - - 25% - - - - - - - - -]
### List of new methods
- [x] bin.newFromBase64(data)
- [x] bin.newFromBase91(data)
- [x] bin.newFromHex(data)
- [x] bin:read(n) -- works just like normal read on a file for both stream/bin files
- [x] bin:sub(a,b) -- works like string.sub() but for bin objects
- [x] bin:seekSet(n) -- sets the seek position on the file
- [x] bin.toBase64(s)
- [x] bin.fromBase64(s)
- [x] bin.toBase91(s)
- [x] bin.fromBase91(s)
- [x] bin.getnumber(num,len,fmt,func)
- [x] New infinabits! Works like bits, but supports numbers up to infinity
- [x] bin.registerBlock(t,funcG,funcA) -- allows you to add custom block commands, I implemented the table block command using this feature
### List of converted methods and their status
- [x] log(data,name,fmt)
- [ ] bin.getLuaVersion()
- [x] bin.load(filename,s,r)
- [x] bin.new(string data) -- Does not accept b64 or hex data anymore! Use new methods for that ^^^
- [x] bin.stream(file,lock)
- [x] bin.newTempFile(data)
- [x] bin:getSize(fmt) -- gets the size of the string fmt is how you want to format it. left empte returns number of bites as a lua number supports lua formats! And also I added the %b format for base64
- [x] bin:getData(fmt) -- returns the data of the object as a string, supports %x(hex), %X(HEX) and %b(base64)
- [x] bits.new(n)
- [ ] bin.newVFS()
- [x] bin:tackE(data) -- tacks data onto the end of a file
- [x] bin:tofile(path)
- [ ] bin.loadVFS(path)
- [x] bin:newDataBuffer(size,fill)
- [ ] bin.bufferToBin(b)
- [ ] bin.binToBuffer(b)
- [ ] bin:getDataBuffer(a,b)
- [ ] bin.newNamedBlock(indexSize)
- [ ] bin.newStreamedNamedBlock(indexSize,path)
- [ ] bin.loadNamedBlock(path)
- [ ] bin.namedBlockManager(arg)
- [ ] bin.randomName(n,ext)
- [ ] ~~bin.NumtoHEX(n)~~
- [ ] ~~bin.HEXtoBin(s)~~
- [ ] ~~bin.HEXtoStr(s)~~
- [x] bin.tohex(s)
- [x] bin.fromhex(s)
- [x] bin.endianflop(data)
- [x] bin.getVersion()
- [ ] bin.escapeStr(str)
- [ ] ~~bin.ToStr(tab)~~
- [ ] ~~bin.packLLIB(name,tab,ext)~~
- [ ] ~~bin.unpackLLIB(name,exe,todir,over,ext)~~
- [ ] ~~bin.fileExist(path)~~ NOW io.fileExists(path)
- [ ] ~~bin.closeto(a,b,v)~~
- [ ] bin.textToBinary(txt)
- [ ] bin.decodeBits(bindata)
- [ ] bin.trimNul(s)
- [ ] bin.getIndexSize(tab)
- [x] bits.numToBytes(num,occ)
- [ ] binobj:tofile(filename)
- [ ] binobj:clone()
- [ ] binobj:compare(other binobj,diff)
- [ ] binobj:sub(a,b)
- [x] binobj:tonumber(a,b)
- [ ] binobj:getbyte(n)
- [ ] binobj:tobits(i)
- [ ] binobj:getHEX(a,b)
- [ ] binobj:scan(s,n,f)
- [ ] binobj:streamData(a,b)
- [ ] binobj:streamread(a,b)
- [x] binobj:canStreamWrite()
- [x] bitobj:conv(n)
- [x] bitobj:tobytes()
- [x] bitobj:tonumber()
- [x] bitobj:isover()
- [x] bitobj:getBin()
- [ ] binobj:getHash(n)
- [ ] binobj:getData()
- [ ] blockReader:getBlock(name)
- [ ] binobj:setEndOfFile(n)
- [ ] binobj:reverse()
- [ ] binobj:flipbits()
- [ ] binobj:segment(a,b)
- [ ] binobj:insert(a,i)
- [ ] binobj:parseN(n)
- [ ] binobj:getlength()
- [ ] binobj:shift(n)
- [ ] binobj:delete(a,b)
- [ ] binobj:encrypt(seed)
- [ ] binobj:decrypt(seed)
- [ ] binobj:shuffle()
- [ ] binobj:mutate(a,i)
- [ ] binobj:merge(o,t)
- [ ] binobj:parseA(n,a,t)
- [ ] binobj:getHEX(a,b)
- [ ] binobj:cryptM()
- [x] binobj:addBlock(d,fit,fmt)
- [x] binobj:getBlock(t,n)
- [x] binobj:seek(n)
- [ ] binobj:morph(a,b,d)
- [ ] binobj:fill(n,d)
- [ ] binobj:fillrandom(n)
- [ ] binobj:shiftbits(n)
- [ ] binobj:shiftbit(n,i)
- [ ] binobj:streamwrite(d,n)
- [ ] ~~binobj:open()~~
- [x] binobj:close()
- [ ] binobj:wipe()
- [ ] binobj:tackB(d)
- [x] binobj:tackE(d,fit,updateseek)
- [ ] binobj:parse(n,f)
- [ ] binobj:flipbit(i)
- [ ] binobj:gsub()
- [ ] blockWriter:addNamedBlock(name,value)
- [ ] ~~bitobj:add(i)~~
- [ ] ~~bitobj:sub(i)~~
- [ ] ~~bitobj:multi(i)~~
- [ ] ~~bitobj:div(i)~~
- [x] bitobj:flipbits()
- [x] bitobj:getBin()