{"id":39072530,"url":"https://github.com/niubaoshu/gotiny","last_synced_at":"2026-01-17T18:23:42.960Z","repository":{"id":46669498,"uuid":"76854839","full_name":"niubaoshu/gotiny","owner":"niubaoshu","description":"gotiny 是一个高效的golang序列化库。","archived":false,"fork":false,"pushed_at":"2024-10-21T06:19:25.000Z","size":160,"stargazers_count":100,"open_issues_count":8,"forks_count":22,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-17T12:38:46.322Z","etag":null,"topics":["gob","gotiny","json","rpc","serialize"],"latest_commit_sha":null,"homepage":"","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/niubaoshu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-19T11:04:15.000Z","updated_at":"2024-10-19T18:45:26.000Z","dependencies_parsed_at":"2024-06-18T15:22:57.170Z","dependency_job_id":"9ef9c256-26e6-48c7-9725-70b2c2b356e5","html_url":"https://github.com/niubaoshu/gotiny","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/niubaoshu/gotiny","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niubaoshu%2Fgotiny","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niubaoshu%2Fgotiny/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niubaoshu%2Fgotiny/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niubaoshu%2Fgotiny/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niubaoshu","download_url":"https://codeload.github.com/niubaoshu/gotiny/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niubaoshu%2Fgotiny/sbom","scorecard":{"id":689468,"data":{"date":"2025-08-11","repo":{"name":"github.com/niubaoshu/gotiny","commit":"4e1282cb5d942140e078a49f39f15792cef46186"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/27 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":"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":"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":"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":"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":"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":"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:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: could not determine whether codeowners review is allowed","Warn: no status checks found to merge onto branch 'master'","Warn: PRs are not required to make changes on branch 'master'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"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"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T01:56:46.380Z","repository_id":46669498,"created_at":"2025-08-22T01:56:46.380Z","updated_at":"2025-08-22T01:56:46.380Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28515413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T17:57:59.192Z","status":"ssl_error","status_checked_at":"2026-01-17T17:57:52.527Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["gob","gotiny","json","rpc","serialize"],"created_at":"2026-01-17T18:23:42.821Z","updated_at":"2026-01-17T18:23:42.943Z","avatar_url":"https://github.com/niubaoshu.png","language":"Go","readme":"## \u003cfont color=\"#FF4500\" \u003egotiny 只是个玩具，不建议使用。\u003c/font\u003e\n\n\n# gotiny   [![Build status][travis-img]][travis-url] [![License][license-img]][license-url] [![GoDoc][doc-img]][doc-url] [![Go Report Card](https://goreportcard.com/badge/github.com/niubaoshu/gotiny)](https://goreportcard.com/report/github.com/niubaoshu/gotiny)\ngotiny是一个注重效率的go语言序列化库。gotiny通过预先生成编码机和减少使用reflect库等方式来提高效率，几乎和生成代码的序列化库有同样高的速度。\n## hello word \n    package main\n    import (\n   \t    \"fmt\"\n   \t    \"github.com/niubaoshu/gotiny\"\n    )\n    \n    func main() {\n   \t    src1, src2 := \"hello\", []byte(\" world!\")\n   \t    ret1, ret2 := \"\", []byte{}\n   \t    gotiny.Unmarshal(gotiny.Marshal(\u0026src1, \u0026src2), \u0026ret1, \u0026ret2)\n   \t    fmt.Println(ret1 + string(ret2)) // print \"hello world!\"\n    }\n\n## 特性\n- 效率非常的高，是golang自带序列化库gob的3倍以上,和一般的生成代码序列化框架处于同一水平，甚至高于它们。\n- 除map类型外0内存申请。\n- 支持编码所有的除func,chan类型外的所有golang内置类型和自定义类型。\n- struct 类型会编码非导出字段,可通过golang tag 的方式设置不编码。\n- 严格的类型转换。gotiny中只有类型完全相同的才会正确编码和解码。\n- 编码带类型的nil值。\n- 可以处理循环类型，不能编码循环值，会栈溢出。\n- 所有可以编码的类型都会完全的解码，不论原值是什么和目标值是什么。\n- 编码生成的字节串不包含类型信息，生成的字节数组非常小。\n## 无法处理循环值 不支持循环引用  TODO \n\ttype a *a\n\tvar b a\n\tb = \u0026b\n\n## install\n```bash\n$ go get -u github.com/niubaoshu/gotiny\n```\n\n## 编码协议\n### 布尔类型\nbool类型占用一位，真值编码为1，假值编码为0。当第一次遇到bool类型时会申请一个字节，将值编入最低位，第二次遇到时编入次低位，第九次遇到bool值时再申请一个字节编入最低位，以此类推。\n### 整数类型\n- uint8和int8 类型作为一个字节编入字符串的下一个字节。\n- uint16,uint32,uint64,uint,uintptr 采用[Varints](https://developers.google.com/protocol-buffers/docs/encoding#varints)编码方式。\n- int16,int32,int64,int 采用ZigZag转换成一个无符号数后采用[Varints](https://developers.google.com/protocol-buffers/docs/encoding#varints)编码方式。\n\n### 浮点数类型\nfloat32和float64采用[gob](https://golang.org/pkg/encoding/gob/)中对浮点类型的编码方式。\n### 复数类型\n- complex64类型会强转为一个uint64后采用uint64的编码方式。\n- complex128类型分别将虚实部分作为float64类型编码。\n\n### 字符串类型\n字符串类型先将字符串长度强转为uint64类型编码，然后将字符串字节数组自身原样编码。\n### 指针类型\n指针类型判断是否为nil，如果是nil，编入一个bool类型的false值后结束，如果不为nil，编入一个bool类型true值，之后将指针解引用，按解引用后的类型编码。\n### array和slice类型\n先将长度强转为一个uint64后采用uint64的编码方式编入，然后将每一个元素安装自身的类型编码。\n### map类型\n同上，先编入长度，然后编入一个健，后面跟健对应的值，在编入一个健，接着是值，以此类推。\n### struct类型\n将结构体的所有成员按其类型编码，无论是否导出，非导出的字段也会编码。结构体会严格还原。\n### 实现接口的类型\n- 对于实现encoding包BinaryMarshaler/BinaryUnmarshaler 或 实现 gob包GobEncoder/GobDecoder 接口的类型会用实现的方法编码。\n- 对于实现了gotiny.GoTinySerialize包的类型将采用实现的方法编码和解码\n\n## benchmark\n[benchmark](https://github.com/niubaoshu/go_serialization_benchmarks)\n\n\n### License\nMIT\n\n[travis-img]: https://travis-ci.org/niubaoshu/gotiny.svg?branch=master\n[travis-url]: https://travis-ci.org/niubaoshu/gotiny\n[license-img]: http://img.shields.io/badge/license-MIT-green.svg?style=flat-square\n[license-url]: http://opensource.org/licenses/MIT\n[doc-img]: http://img.shields.io/badge/GoDoc-reference-blue.svg?style=flat-square\n[doc-url]: https://godoc.org/github.com/niubaoshu/gotiny\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniubaoshu%2Fgotiny","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniubaoshu%2Fgotiny","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniubaoshu%2Fgotiny/lists"}