{"id":18104051,"url":"https://github.com/dearblue/mruby-lz4","last_synced_at":"2025-04-06T05:48:22.127Z","repository":{"id":54872343,"uuid":"96895647","full_name":"dearblue/mruby-lz4","owner":"dearblue","description":"mruby bindings for lz4","archived":false,"fork":false,"pushed_at":"2022-08-20T08:24:30.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"wip","last_synced_at":"2025-02-12T11:34:43.643Z","etag":null,"topics":["compressions","lz4","mruby"],"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:23:39.000Z","updated_at":"2022-08-20T08:24:33.000Z","dependencies_parsed_at":"2022-08-14T05:20:30.054Z","dependency_job_id":null,"html_url":"https://github.com/dearblue/mruby-lz4","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-lz4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearblue%2Fmruby-lz4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearblue%2Fmruby-lz4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearblue%2Fmruby-lz4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dearblue","download_url":"https://codeload.github.com/dearblue/mruby-lz4/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","lz4","mruby"],"created_at":"2024-10-31T22:13:49.192Z","updated_at":"2025-04-06T05:48:22.102Z","avatar_url":"https://github.com/dearblue.png","language":"C","readme":"# mruby-lz4 : mruby bindings for lz4 the compression library (unofficial)\n\nmruby へ LZ4 圧縮ライブラリの機能を提供します。\n\n  - LZ4 Frame データの圧縮・伸長が行なえます。\n\n    LZ4::Encoder / LZ4::Decoder\n\n  - LZ4 Block データの圧縮・伸長が行なえます。\n\n    LZ4::BlockEncoder / LZ4::BlockDecoder\n\n## ****注意***\n\n  - LZ4 Frame API は mruby のメモリアロケータを通してメモリが確保されません。\n\n    メモリ関連で不可解な挙動があった場合、このことが原因であるかもしれません。\n\n\n## HOW TO USAGE\n\n### 圧縮 (LZ4 Block Format)\n\n```ruby\nsrc = \"123456789\"\ndest = LZ4.block_encode(src)\n```\n\n圧縮レベルを指定したい場合:\n\n```ruby\nsrc = \"123456789\"\ncomplevel = 10 # 整数値を与える。既定値は -1 で、C の LZ4_compress_fast() と等価\n               # 負の値であれば LZ4_compress_fast_continue() の accelerator に絶対値を渡すことを意味する\n               # 0 以上の値であれば LZ4_resetStreamHC() の level に値を渡すことを意味する\ndest = LZ4.block_encode(src, level: complevel)\n```\n\n### 伸長 (LZ4 Block Format)\n\n```ruby\nlz4seq = ... # lz4'd string by LZ4.block_encode\ndest = LZ4.block_decode(lz4seq)\n```\n\n### 圧縮 (LZ4 Frame Format)\n\n```ruby\nsrc = \"123456789\"\ndest = LZ4.encode(src)\n```\n\n圧縮レベルを指定したい場合:\n\n```ruby\nsrc = \"123456789\"\ncomplevel = 15 # 1..22 の範囲で与える。既定値は nil で、1 と等価\ndest = LZ4.encode(src, level: complevel)\n```\n\n### 伸長 (LZ4 Frame Format)\n\n```ruby\nlz4seq = ... # lz4'd string by LZ4.encode\n              # OR .lz4 file data by lz4-cli\ndest = LZ4.decode(lz4seq)\n```\n\n### ストリーミング圧縮 (LZ4 Frame Format)\n\n```ruby\noutput = AnyObject.new # An object that has ``.\u003c\u003c'' method (e.g. IO, StringIO, or etc.)\nLZ4.encode(output) do |lz4|\n  lz4 \u003c\u003c \"abcdefg\"\n  lz4 \u003c\u003c \"123456789\" * 99\nend\n```\n\n### ストリーミング伸長 (LZ4 Frame Format)\n\n```ruby\ninput = AnyObject.new # An object that has ``.read'' method (e.g. IO, StringIO, or etc.)\nLZ4.decode(input) do |lz4|\n  lz4.read(20)\n  buf = \"\"\n  lz4.read(5, buf)\n  lz4.read(10, buf)\n  lz4.read(nil, buf)\nend\n```\n\n\n## Specification\n\n  - Product name: [mruby-lz4](https://github.com/dearblue/mruby-lz4)\n  - Version: 0.5.3\n  - Product quality: PROTOTYPE\n  - Author: [dearblue](https://github.com/dearblue)\n  - Report issue to: \u003chttps://github.com/dearblue/mruby-lz4/issues\u003e\n  - Licensing: [2 clause BSD License](LICENSE)\n  - Dependency external mrbgems:\n      - [mruby-aux](https://github.com/dearblue/mruby-aux)\n        under [Creative Commons Zero License \\(CC0\\)](https://github.com/dearblue/mruby-aux/blob/master/LICENSE)\n        by [dearblue](https://github.com/dearblue)\n  - Bundled C libraries (git-submodules):\n      - [lz4](https://github.com/lz4/lz4)-[1.9.4](https://github.com/lz4/lz4/tree/v1.9.4)\n        under [2 clause BSD License](https://github.com/lz4/lz4/blob/v1.9.4/LICENSE)\n        by [Yann Collet](https://github.com/Cyan4973)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdearblue%2Fmruby-lz4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdearblue%2Fmruby-lz4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdearblue%2Fmruby-lz4/lists"}