{"id":36490780,"url":"https://github.com/bnclabs/gson","last_synced_at":"2026-01-12T01:55:39.289Z","repository":{"id":21391026,"uuid":"24708760","full_name":"bnclabs/gson","owner":"bnclabs","description":"Algorithms on data formats - JSON, CBOR, Collation.","archived":false,"fork":false,"pushed_at":"2021-04-09T01:16:12.000Z","size":6973,"stargazers_count":18,"open_issues_count":16,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T00:37:05.755Z","etag":null,"topics":["cbor","collation","golang","json","json-pointer","sort"],"latest_commit_sha":null,"homepage":"http://prataprc.github.io/jsonsort.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bnclabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-02T06:30:43.000Z","updated_at":"2024-02-20T09:33:30.000Z","dependencies_parsed_at":"2022-07-30T04:37:59.072Z","dependency_job_id":null,"html_url":"https://github.com/bnclabs/gson","commit_stats":null,"previous_names":["prataprc/gson"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bnclabs/gson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnclabs%2Fgson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnclabs%2Fgson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnclabs%2Fgson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnclabs%2Fgson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnclabs","download_url":"https://codeload.github.com/bnclabs/gson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnclabs%2Fgson/sbom","scorecard":{"id":245926,"data":{"date":"2025-08-11","repo":{"name":"github.com/bnclabs/gson","commit":"2e73bae93c0bc17e29630c40fa74d2c556c2c0d7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T07:37:10.097Z","repository_id":21391026,"created_at":"2025-08-17T07:37:10.097Z","updated_at":"2025-08-17T07:37:10.097Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cbor","collation","golang","json","json-pointer","sort"],"created_at":"2026-01-12T01:55:38.584Z","updated_at":"2026-01-12T01:55:39.280Z","avatar_url":"https://github.com/bnclabs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Object formats and notations\n============================\n\n[![Build Status](https://travis-ci.org/bnclabs/gson.png)](https://travis-ci.org/bnclabs/gson)\n[![Coverage Status](https://coveralls.io/repos/github/bnclabs/gson/badge.svg?branch=master)](https://coveralls.io/github/bnclabs/gson?branch=master)\n[![GoDoc](https://godoc.org/github.com/bnclabs/gson?status.png)](https://godoc.org/github.com/bnclabs/gson)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bnclabs/gson)](https://goreportcard.com/report/github.com/bnclabs/gson)\n[![GitPitch](https://gitpitch.com/assets/badge.svg)](https://gitpitch.com/bnclabs/gson/master?grs=github\u0026t=white)\n\n- High performance algorithms for data transformation, serialization and\n  manipulation.\n- Based on well established standards.\n- ZERO allocation when transforming from one format to another, except\n  for APIs creating golang values from encoded data.\n- [JSON](http://json.org) for web.\n- [CBOR](http://cbor.io) for machine.\n- [Binary-Collation][jsonsort] for crazy fast comparison/sorting.\n\n**This package is under continuous development, but the APIs are fairly stable**.\n\nQuick Links\n-----------\n\n* [Slides on gson][gitpitch-link]\n* [What is what](#what-is-what)\n* [Configuration](#configuration)\n* [Transforms](#transforms)\n* [Understanding collation][jsonsort]\n* [Getting started](docs/gettingstarted.md)\n* [Play with command line](cmd/README.md)\n* [Articles related to gson](#articles)\n* [How to contribute](#how-to-contribute)\n\nWhat is what\n------------\n\n**JSON**\n\n* Java Script Object Notation, also called [JSON][JSON-link],\n  [RFC-7159][RFC7159-link]\n* Fast becoming the internet standard for data exchange.\n* Human readable format, not so friendly for machine representation.\n\n**Value (aka gson)**\n\n* Golang object parsed from JSON, CBOR or collate representation.\n* JSON arrays are represented in golang as `[]interface{}`.\n* JSON objects, aka properties, are presented in golang as\n  `map[string]interface{}`.\n* Following golang-types can be transformed to JSON, CBOR, or,\n  [Binary-collation][jsonsort] - `nil`, `bool`,\n  `byte, int8, int16, uint16, int32, uint32, int, uint, int64, uint64`,\n  `float32, float64`,\n  `string`, `[]interface{}`, `map[string]interface{}`,\n  `[][2]interface{}`.\n* For type `[][2]interface{}`, first item is treated as key (string) and\n  second item is treated as value, hence equivalent to\n  `map[string]interface{}`.\n* Gson objects support operations like, Get(), Set(), and\n  Delete() on individual fields located by the json-pointer.\n\n**CBOR**\n\n* Concise Binary Object Representation, also called [CBOR][CBOR-link],\n  [RFC-7049link][RFC7049-link].\n* Machine friendly, designed for IoT, inter-networking of light weight\n  devices, and easy to implement in many languages.\n* Can be used for more than data exchange, left to user\n  imagination :) ...\n\n**Binary-Collation**\n\n* A custom encoding based on a [paper](docs/collate.pdf) and improvised to\n  handle JSON specification.\n* Binary representation preserving the sort order.\n* Transform back to original JSON from binary representation.\n* Numbers can be treated as floating-point, for better performance or either as\n  floating-point or integer, for flexibility.\n* More details can be found [here][jsonsort]\n\n**JSON-Pointer**\n\n* URL like field locator within a JSON object, [RFC-6901][RFC6901-link].\n* For navigating through JSON arrays and objects, but to any level of nesting.\n* JSON-pointers shall be unquoted before they are used as path into\n  JSON document.\n* Documents encoded in CBOR format using LengthPrefix are not\n  supported by lookup APIs.\n\nPerformance and memory pressure\n-------------------------------\n\nFollowing Benchmark is made on a map data which has a shape similar to:\n\n```json\n{\"key1\": nil, \"key2\": true, \"key3\": false,\n\"key4\": \"hello world\", \"key5\": 10.23122312}\n```\n\nor,\n\n```go\n{\"a\":null,\"b\":true,\"c\":false,\"d\\\"\":10,\"e\":\"tru\\\"e\", \"f\":[1,2]}\n```\n\n```text\nBenchmarkVal2JsonMap5-8  3000000   461 ns/op    0 B/op  0 allocs/op\nBenchmarkVal2CborMap5-8  5000000   262 ns/op    0 B/op  0 allocs/op\nBenchmarkVal2CollMap-8   1000000  1321 ns/op  128 B/op  2 allocs/op\nBenchmarkJson2CborMap-8  2000000   838 ns/op    0 B/op  0 allocs/op\nBenchmarkCbor2JsonMap-8  2000000  1010 ns/op    0 B/op  0 allocs/op\nBenchmarkJson2CollMap-8  1000000  1825 ns/op  202 B/op  2 allocs/op\nBenchmarkColl2JsonMap-8  1000000  2028 ns/op  434 B/op  6 allocs/op\nBenchmarkCbor2CollMap-8  1000000  1692 ns/op  131 B/op  2 allocs/op\nBenchmarkColl2CborMap-8  1000000  1769 ns/op  440 B/op  6 allocs/op\n```\n\nThough converting to golang value incurs cost.\n\n```text\nBenchmarkJson2ValMap5    1000000  1621 ns/op   699 B/op  14 allocs/op\nBenchmarkCbor2ValMap5    1000000  1711 ns/op   496 B/op  18 allocs/op\nBenchmarkColl2ValMap     1000000  2235 ns/op  1440 B/op  33 allocs/op\n```\nConfiguration\n-------------\n\n**Configuration APIs are not re-entrant**. For concurrent use of Gson, please\ncreate a `gson.Config{}` per routine, or protect them with a mutex.\n\n**NumberKind**\n\nThere are two ways to treat numbers in Gson, as integers (upto 64-bit width)\nor floating-point (float64).\n\n- **FloatNumber** configuration can be used to tell Gson to treat all numbers\nas floating point. This has the convenience of having precision between\ndiscrete values, but suffers round of errors and inability to represent\ninteger values greater than 2^53. **DEFAULT choice**.\n\n- **SmartNumber** will use int64, uint64 for representing integer values and\nuse float64 when decimal precision is required. Choosing this option, Gson\nmight incur a slight performance penalty.\n\nCan be configured per configuration instance via `SetNumberKind()`.\n\n**MaxKeys**\n\nMaximum number of keys allowed in a property object. This can be configured\nglobally via `gson.MaxKeys` or per configuration via `SetMaxkeys()`.\n\n**Memory-pools**\n\nGson uses memory pools:\n\n* Pool of Byte blocks for listing json-pointers.\n* Pool of Byte blocks for for encoding / decoding string types,\n  and property keys.\n* Pool of set of strings for sorting keys within property.\n\nMemory foot print of gson depends on the pools size, maximum length of\ninput string, number keys in input property-map.\n\nMempools can be configured globally via\n`gson.MaxStringLen, gson.MaxKeys, gson.MaxCollateLen, gson.MaxJsonpointerLen`\npackage variables or per configuration instance via `ResetPools()`.\n\n**CBOR ContainerEncoding**\n\nIn CBOR both map and array (called container types) can be encoded as length\nfollowed by items, or items followed by end-marker.\n\n- **LengthPrefix** to encode length of container type first, followed by\n  each item in the container.\n- **Stream** to encode each item in the container as it appears in the input\n  stream, finally ending it with a End-Stream-Marker. **DEFAULT choice**.\n\nCan be configured per configuration instance via `SetContainerEncoding`\n\n**JSON Strict**\n\n- If configured as true, encode / decode JSON strings operations will use\nGolang's encoding / JSON package.\n\nCan be configured per configuration instance via `SetStrict`.\n\n**JSON SpaceKind**\n\nHow to interpret space characters ? There are two options:\n\n- **AnsiSpace** will be faster but does not support unicode.\n- **UnicodeSpace** will be slower but supports unicode. **DEFAULT choice**.\n\nCan be configured per configuration instance via `SetSpaceKind`.\n\n**Collate ArrayLenPrefix**\n\nWhile sorting array, which is a container type, should collation algorithm\nconsider the arity of the array ? If ArrayLenPrefix prefix is configured as\ntrue, arrays with more number of items will sort after arrays with lesser\nnumber of items.\n\nCan be configured per configuration instance via `SortbyArrayLen`.\n\n**Collate PropertyLenPrefix**\n\nWhile sorting property-map, which is a container type, should collation\nalgorithm consider number of entries in the map ? If PropertyLenPrefix is\nconfigured as true, maps with more number of items will sort after maps\nwith lesser number of items.\n\nCan be configured per configuration instance via `SortbyPropertyLen`.\n\n**JSON-Pointer JsonpointerLength**\n\nMaximum length a JSON-pointer string can take. Can be configured globally\nvia MaxJsonpointerLen or per configuration instance via `SetJptrlen`.\n\nNOTE: JSON pointers are composed of path segments, there is an upper limit\nto the number of path-segments a JSON pointer can have. If your configuration\nexceeds that limit, try increasing the JsonpointerLength.\n\nTransforms\n----------\n\n![transforms](docs/transforms.png)\n\n**Value to CBOR**\n\n* Golang types `nil`, `true`, `false` are encodable into CBOR\n  format.\n* All Golang `number` types, including signed, unsigned, and\n  floating-point variants, are encodable into CBOR format.\n* Type `[]byte` is encoded as CBOR byte-string.\n* Type `string` is encoded as CBOR text.\n* Generic `array` is interpreted as Golang `[]interface{}` and\n  encoded as CBOR array.\n  * With `LengthPrefix` option for ContainerEncoding, arrays and\n    maps are encoded with its length.\n  * With `Stream` option, arrays and maps are encoded using\n    Indefinite and Breakstop encoding.\n* Generic `property` is interpreted as golang `[][2]interface{}`\n  and encoded as CBOR array of 2-element array, where the first item\n  is key represented as string and second item is any valid JSON\n  value.\n* Before encoding `map[string]interface{}` type, use\n  `GolangMap2cborMap()` function to transform them to\n  `[][2]interface{}`.\n* Following golang data types are encoded using CBOR-tags,\n  * Type `time.Time` encoded with tag-0.\n  * Type `Epoch` type supplied by CBOR package, encoded\n    with tag-1.\n  * Type `EpochMicro` type supplied by CBOR package, encoded\n    with tag-1.\n  * Type `math/big.Int` positive numbers are encoded with tag-2, and\n    negative numbers are encoded with tag-3.\n  * Type `DecimalFraction` type supplied by CBOR package,\n    encoded with tag-4.\n  * Type `BigFloat` type supplied by CBOR package, encoded\n    with tag-5.\n  * Type `CborTagBytes` type supplied by CBOR package, encoded with\n    tag-24.\n  * Type `regexp.Regexp` encoded with tag-35.\n  * Type `CborTagPrefix` type supplied by CBOR package, encoded\n    with tag-55799.\n* All other types shall cause a panic.\n\n**Value to collate**\n\n* Types `nil`, `true`, `false`, `float64`, `int64`, `int`,\n  `string`, `[]byte`, `[]interface{}`, `map[string]interface{}`\n  are supported for collation.\n* All JSON numbers are collated as arbitrary sized floating point numbers.\n* Array-length (if configured) and property-length (if configured) are\n  collated as integer.\n\n**JSON to Value**\n\n* Gson uses custom parser that must be faster than encoding/JSON.\n* Numbers can be interpreted as integer, or float64,\n  -  `FloatNumber` to interpret JSON number as 64-bit floating point.\n  -  `SmartNumber` to interpret JSON number as int64, or uint64, or float64.\n* Whitespace can be interpreted, based on configuration type `SpaceKind`.\n  SpaceKind can be one of the following `AnsiSpace` or `UnicodeSpace`.\n  - `AnsiSpace` that should be faster\n  - `UnicodeSpace` supports unicode white-spaces as well.\n\n**JSON to collate**\n\n* All number are collated as float.\n* If config.nk is FloatNumber, all numbers are interpreted as float64\n  and collated as float64.\n* If config.nk is SmartNumber, all JSON numbers are collated as arbitrary\n  sized floating point numbers.\n* Array-length (if configured) and property-length (if configured) are\n  collated as integer.\n\n**JSON to CBOR**\n\n* JSON Types `null`, `true`, `false` are encodable into CBOR format.\n* Types `number` are encoded based on configuration type `NumberKind`,\n  which can be one of the following.\n  * If config.nk is FloatNumber, all numbers are encoded as CBOR-float64.\n  * If config.nk is SmartNumber, all JSON float64 numbers are encoded as\n    CBOR-float64, and, all JSON positive integers are encoded as\n    CBOR-uint64, and, all JSON negative integers are encoded as\n    CBOR-int64.\n* Type `string` will be parsed and translated into UTF-8, and subsequently\n  encoded as CBOR-text.\n* Type `arrays` can be encoded in `Stream` mode, using CBOR's\n  indefinite-length scheme, or in `LengthPrefix` mode.\n* Type `properties` can be encoded either using CBOR's indefinite-length\n  scheme (`Stream`), or using CBOR's `LengthPrefix`.\n* Property-keys are always interpreted as string and encoded as \n  UTF-8 CBOR-text.\n\n**CBOR to Value**\n\n* Reverse of all `value to CBOR` encoding, described above, are\n  supported.\n* Cannot decode `float16` type and int64 \u003e 9223372036854775807.\n* Indefinite byte-string chunks, text chunks shall be decoded outside\n  this package using `IsIndefinite*()` and `IsBreakstop()` APIs.\n\n**CBOR to JSON**\n\n* CBOR types `nil`, `true`, `false` are transformed back to equivalent\n  JSON types.\n* Types `float32` and `float64` are transformed back to 32 bit\n  JSON-float and 64 bit JSON-float respectively, in\n  non-exponent format.\n* Type `integer` is transformed back to JSON-integer representation,\n  and integers exceeding 9223372036854775807 are not supported.\n* Type `array` either with length prefix or with indefinite encoding\n  are converted back to JSON array.\n* Type `map` either with length prefix or with indefinite encoding\n  are converted back to JSON property.\n* Type bytes-strings are not supported or transformed to JSON.\n* Type CBOR-text with indefinite encoding are not supported.\n* Type Simple type float16 are not supported.\n\nFor transforming to and from binary-collation refer [here][jsonsort]\n\n**CBOR to Collate**\n\n* CBOR Types `null`, `true`, `false`, `float32`, `float64`, `integer`,\n  `string`, `[]byte` (aka binary), `array`, `object` can be\n  collated.\n* All number are collated as float.\n* If config.nk is FloatNumber, all numbers are interpreted as float64\n  and collated as float64.\n* If config.nk is SmartNumber, all JSON numbers are collated as arbitrary\n  sized floating point numbers.\n* Array-length (if configured) and property-length (if configured) are\n  collated as integer.\n* Indefinite-length encoding for text and binary are not supported.\n* LengthPrefix and Stream encoding for array and maps are supported.\n\n**Collate to CBOR**\n\n* `Missing`, `null`, `true`, `false`, `floating-point`, `small-decimal`,\n  `integer`, `string`, `[]byte` (aka binary), `array`, `object` types\n  from its collated from can be converted back to CBOR.\n* Since all numbers are collated as float, it is converted back to text\n  representation of float, in format: [+-]x.\u003cmantissa\u003ee[+-]\u003cexp\u003e.\n* If config.nk is FloatNumber, all number are encoded as CBOR-float64.\n* If config.nk is SmartNumber, all numbers whose exponent is \u003e= 15 is encoded\n  as uint64 (if number is positive), or int64 (if number is negative).\n  Others are encoded as CBOR-float64.\n\n**Collate to JSON**\n\n* Since all numbers are collated as float, it is converted back to text\n  representation of float, in format: [+-]x.\u003cmantissa\u003ee[+-]\u003cexp\u003e.\n* If config.nk is FloatNumber, all number are encoded as JSON-float64.\n* If config.nk is SmartNumber, all numers whose exponent is \u003e= 15 is encoded\n  as uint64 (if number is positive), or int64 (if number is negative).\n  Others are encoded as JSON-float64.\n\n**Collate to Value**\n\n* Since all numbers are collated as float, it is converted back to text\n  representation of float, in format: [+-]x.\u003cmantissa\u003ee[+-]\u003cexp\u003e.\n* If config.nk is FloatNumber, all number are encoded as JSON-float64.\n* If config.nk is SmartNumber, all numers whose exponent is \u003e= 15 is encoded\n  as uint64 (if number is positive), or int64 (if number is negative).\n  Others are treated as float64.\n\n\nArticles\n--------\n\n* [Note on sorting][article1-link]\n\nHow to contribute\n-----------------\n\n[![Issue Stats](http://issuestats.com/github/bnclabs/gson/badge/issue)](http://issuestats.com/github/bnclabs/gson)\n[![Issue Stats](http://issuestats.com/github/bnclabs/gson/badge/pr)](http://issuestats.com/github/bnclabs/gson)\n\n* Pick an issue, or create an new issue. Provide adequate documentation for\n  the issue.\n* Assign the issue or get it assigned.\n* Work on the code, once finished, raise a pull request.\n* Gson is written in [golang](https://golang.org/), hence expected to follow the\n  global guidelines for writing go programs.\n* If the changeset is more than few lines, please generate a\n  [report card](https://goreportcard.com/report/github.com/bnclabs/gson).\n* As of now, branch `master` is the development branch.\n\n**Task list**\n\n* [x] Binary collation: transparently handle int64, uint64 and float64.\n* [x] Support for json.Number.\n* [ ] UTF-8 collation of strings.\n* [ ] JSON-pointer.\n  - [ ] JSON pointer for looking up within CBOR map.\n  - [ ] JSON pointer for looking up within value-map.\n\nNotes\n-----\n\n* Don't change the tag number.\n* All supplied APIs will panic in case of error, applications can\n  recover from panic, dump a stack trace along with input passed on to\n  the API, and subsequently handle all such panics as a single valued\n  error.\n* For now, maximum integer range shall be within int64.\n* `Config` instances, and its APIs, are neither re-entrant nor thread safe.\n\n**list of changes from github.com/prataprc/collatejson**\n\n* Codec type is renamed to Config.\n* Caller should make sure that the o/p buffer passed to encoding\n  and decoding APIs are adequately sized.\n* Name and signature of NewCodec() (now, NewDefaultConfig) has changed.\n* Configuration APIs,SortbyArrayLen, SortbyPropertyLen, UseMissing, NumberType\n  all now return the config object back the caller - helps in call-chaining.\n* All APIs panic instead of returning an error.\n* Output buffer should have its len() == cap(), so that encoder and decoder\n  can avoid append and instead use buffer index.\n\n[gitpitch-link]: https://gitpitch.com/bnclabs/gson/master?grs=github\u0026t=white\n[JSON-link]: http://www.json.org/\n[RFC7159-link]: https://tools.ietf.org/html/rfc7159\n[CBOR-link]: http://cbor.io/\n[RFC7049-link]: https://tools.ietf.org/html/rfc7049\n[RFC6901-link]: https://tools.ietf.org/html/rfc6901\n[article1-link]: http://prataprc.github.io/sorting-data.html\n[jsonsort]: https://prataprc.github.io/jsonsort.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnclabs%2Fgson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnclabs%2Fgson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnclabs%2Fgson/lists"}