Git Product home page Git Product logo

hson's Introduction

Hash check JSON storage

HSON test HSON build release

(This is an experimental repository which learning to use cgo and compile dynamic libray with GitHub Action)

HSON is JSON based data storage manager library with SHA-3 hashing as checksum for validating JSON context and compressed by GZip as a side project of will_pub's data storage solution

File extension

HSON will generate a binary data file (and yes, it the same structre of JSON) with GZip compressed, the file must be named with this extensions:

  • .hson
  • .hashjson

It returned error if a file does not obey extension naming.

API

Name Description Return value
readHSON(path *C.char) *C.Char Read HSON file context from the path Raw JSON string if read data successfully, or empty string if not
writeHSON(context, path *C.Char) C.int Write HSON context to a file
  • 0 if write data successfully
  • 1 if failed during updating context (can not generate hash or non JSON data applied)
  • 2 if failed during writing to file

Cross platform ability

Read HSON with cross platform compability is yes and no since it depends the context has indented or not. If the context is minified (which wrapping data in a single line), it higher chance will be recognized. However, it not 100% worked if indented since different OS may use different new line in code.

Note for macOS users

Please download go 1.17.x, clone this project and run make build by yourself. I have no Mac.

Good news! AMD64 based macOS is available now! (You still need to compile by yourself if using Apple Silicon)

License

WTFPL

hson's People

Contributors

rk0cc avatar

Watchers

 avatar  avatar

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.