https://github.com/jmank88/ubjson
Go package for working with Universal Binary JSON - http://ubjson.org/
https://github.com/jmank88/ubjson
go golang json ubjson
Last synced: about 1 year ago
JSON representation
Go package for working with Universal Binary JSON - http://ubjson.org/
- Host: GitHub
- URL: https://github.com/jmank88/ubjson
- Owner: jmank88
- License: mit
- Created: 2016-06-02T00:21:35.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-10-01T01:52:49.000Z (over 2 years ago)
- Last Synced: 2025-05-07T10:34:46.252Z (about 1 year ago)
- Topics: go, golang, json, ubjson
- Language: Go
- Homepage:
- Size: 171 KB
- Stars: 13
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UBJSON [](https://godoc.org/github.com/jmank88/ubjson) [](https://github.com/jmank88/ubjson/actions) [](https://goreportcard.com/report/github.com/jmank88/ubjson)
A Go package implementing encoding and decoding of [Universal Binary JSON](http://ubjson.org/) (spec 12).
## Features
- Type specific methods for built-in types.
- Automatic encoding via reflection for most types.
- Custom encoding via Value interface.
- Streaming support via Encoder/Decoder.
- Support for [optimized format](http://ubjson.org/type-reference/container-types/#optimized-format).
- Block format.
## Usage
```go
b, _ := ubjson.MarshalBlock(8)
// [U][8]
b, _ = ubjson.MarshalBlock("hello")
// [S][U][5][hello]
var v interface{}
...
b, _ = ubjson.Marshal(v)
// ...
```
See the [GoDoc](https://godoc.org/github.com/jmank88/ubjson) for more
information and [examples](https://godoc.org/github.com/jmank88/ubjson#pkg-examples).