{"id":18104020,"url":"https://github.com/dearblue/mruby-zstd","last_synced_at":"2025-04-06T05:48:18.490Z","repository":{"id":54693142,"uuid":"96895801","full_name":"dearblue/mruby-zstd","owner":"dearblue","description":"mruby bindings for zstd","archived":false,"fork":false,"pushed_at":"2021-02-03T14:55:03.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"wip","last_synced_at":"2025-02-12T11:34:39.457Z","etag":null,"topics":["compressions","mruby","zstd"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dearblue.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}},"created_at":"2017-07-11T13:25:07.000Z","updated_at":"2022-01-07T21:47:56.000Z","dependencies_parsed_at":"2022-08-14T00:10:43.821Z","dependency_job_id":null,"html_url":"https://github.com/dearblue/mruby-zstd","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearblue%2Fmruby-zstd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearblue%2Fmruby-zstd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearblue%2Fmruby-zstd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearblue%2Fmruby-zstd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dearblue","download_url":"https://codeload.github.com/dearblue/mruby-zstd/tar.gz/refs/heads/wip","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441006,"owners_count":20939235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["compressions","mruby","zstd"],"created_at":"2024-10-31T22:13:46.067Z","updated_at":"2025-04-06T05:48:18.466Z","avatar_url":"https://github.com/dearblue.png","language":"C","readme":"# mruby-zstd : mruby bindings for zstd the compression library (unofficial)\n\n## HOW TO INSTALL\n\n`build_config.rb` に `gem mgem: \"mruby-zstd\"` を追加して下さい。\n\n```ruby\nMRuby::Build.new do |conf|\n  gem mgem: \"mruby-zstd\"\nend\n```\n\n## HOW TO USAGE\n\n### 圧縮\n\n```ruby\nsrc = \"123456789\"\ndest = Zstd.encode(src)\n```\n\n圧縮レベルを指定したい場合:\n\n```ruby\nsrc = \"123456789\"\ncomplevel = 15 # 1..22 の範囲で与える。既定値は nil で、1 と等価\ndest = Zstd.encode(src, level: complevel)\n```\n\n### 伸長\n\n```ruby\nzstdseq = ... # zstd'd string by Zstd.encode\n              # OR .zst file data by zstd-cli\ndest = Zstd.decode(zstdseq)\n```\n\n### ストリーミング圧縮\n\n```ruby\noutput = AnyObject.new # An object that has ``.\u003c\u003c'' method (e.g. IO, StringIO, or etc.)\nZstd.encode(output) do |zstd|\n  zstd \u003c\u003c \"abcdefg\"\n  zstd \u003c\u003c \"123456789\" * 99\nend\n```\n\n### ストリーミング伸長\n\n```ruby\ninput = AnyObject.new # An object that has ``.read'' method (e.g. IO, StringIO, or etc.)\nZstd.decode(input) do |zstd|\n  zstd.read(20)\n  buf = \"\"\n  zstd.read(5, buf)\n  zstd.read(10, buf)\n  zstd.read(nil, buf)\nend\n```\n\n\n## build_config.rb\n\n### ``ZSTD_LEGACY_SUPPORT``\n\n``build_config.rb`` で ``ZSTD_LEGACY_SUPPORT`` を定義することによって、zstd-1.0 以前のデータ形式を伸長できるようになります。\n\n```ruby:build_config.rb\nMRuby::Build.new(\"host\") do |conf|\n  conf.cc.defines \u003c\u003c \"ZSTD_LEGACY_SUPPORT\"\n\n  ...\nend\n```\n\n### ``MRUBY_ZSTD_DEFAULT_PARTIAL_SIZE``\n\n``build_config.rb`` で ``MRUBY_ZSTD_DEFAULT_PARTIAL_SIZE`` を定義することによって、段階的なメモリ拡張サイズを指定することが出来ます。\n\n```ruby:build_config.rb\nMRuby::Build.new(\"host\") do |conf|\n  conf.cc.defines \u003c\u003c \"MRUBY_ZSTD_DEFAULT_PARTIAL_SIZE=65536\"\n\n  ...\nend\n```\n\n既定値は、MRB_INT_16 が定義された場合は 4 KiB、それ以外の場合は 1 MiB となっています。\n\n\n## Specification\n\n  - Product name: [mruby-zstd](https://github.com/dearblue/mruby-zstd)\n  - Version: 0.2.4\n  - Product quality: PROTOTYPE\n  - Author: [dearblue](https://github.com/dearblue)\n  - Report issue to: \u003chttps://github.com/dearblue/mruby-zstd/issues\u003e\n  - Licensing: [2 clause BSD License](LICENSE)\n  - Dependency external mrbgems: (NONE)\n  - Bundled C libraries (git-submodule'd):\n      - [zstd](https://github.com/facebook/zstd)\n        [version 1.4.8](https://github.com/facebook/zstd/tree/v1.4.8)\n        under [3 clause BSD License](https://github.com/facebook/zstd/blob/v1.4.8/LICENSE)\n        by [Facebook](https://github.com/facebook)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdearblue%2Fmruby-zstd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdearblue%2Fmruby-zstd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdearblue%2Fmruby-zstd/lists"}