Git Product home page Git Product logo

bson.ahk's Introduction

BSON.ahk

BSON.ahk is a small(-ish) AHK library for loading/dumping objects in the BSON format.

How to use

Just copy the the \lib folder into the same folder as your script, and add #Include <BSON> to your script, then you can call the various methods of the BSON class.

Methods

Dumping

BSON.Dump(Object) will dump the object into BSON, and then return an array of bytes containing the BSON representation of the object.

BSON.Dump.ToFile(FilePath, Object) will do the same as BSON.Dump(), but will write the bytes directly into a file.

BSON.Dump.ToHexString(Object) also does the same as BSON.Dump(), but converts the array of bytes into hex, builds a string out of each byte, seperated by a space.

Loading

BSON.Load(Bytes) expects an array of bytes (Like the one BSON.Dump(Object) returns), and will return the decoded BSON as an AHK object.

BSON.Load.FromFile(FilePath) will read the BSON data from the given file, and then return the decoded BSON as an AHK object.

BSON.Load.FromHexString(String) will convert the hex data back into binary, load it, and then return the decoded BSON as (you guessed it) an AHK object.

Dependencies

All dependencies are included in \lib, and are also written by me; however, they are not on github since they are just quick helpers.

Conversions.ahk is required to load/dump hex encoded BSON.

ScanningBuffer.ahk is required to reuse the same code for loading from a file to load from any buffer in memory. By implementing (almost) all File Object methods, the ScanningBuffer class can be swapped in/out for File Objects inside of the internal BSON parsing methods.

bson.ahk's People

Contributors

cloakersmoker avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

poa00

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.