{"id":13520267,"url":"https://github.com/fny/xorcist","last_synced_at":"2025-04-07T06:08:02.941Z","repository":{"id":34928083,"uuid":"38992834","full_name":"fny/xorcist","owner":"fny","description":"Blazing-fast-cross-platform-monkey-patch-free string XOR","archived":false,"fork":false,"pushed_at":"2024-09-07T21:54:33.000Z","size":57,"stargazers_count":37,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-06T00:02:25.784Z","etag":null,"topics":["cryptography","encodings","jruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/fny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2015-07-13T05:27:00.000Z","updated_at":"2024-09-07T21:54:37.000Z","dependencies_parsed_at":"2025-03-16T11:07:47.195Z","dependency_job_id":"4bbfbea6-ab47-4067-819a-a9b07885c782","html_url":"https://github.com/fny/xorcist","commit_stats":{"total_commits":61,"total_committers":6,"mean_commits":"10.166666666666666","dds":"0.21311475409836067","last_synced_commit":"d09633feac250fba7108bb8410cd1f5d8606de96"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fny%2Fxorcist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fny%2Fxorcist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fny%2Fxorcist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fny%2Fxorcist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fny","download_url":"https://codeload.github.com/fny/xorcist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"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":["cryptography","encodings","jruby"],"created_at":"2024-08-01T05:02:16.053Z","updated_at":"2025-04-07T06:08:02.924Z","avatar_url":"https://github.com/fny.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Xorcist :ghost:\n\n[![Gem Version](https://badge.fury.io/rb/xorcist.svg)](http://badge.fury.io/rb/xorcist)\n[![Test](https://github.com/fny/xorcist/actions/workflows/test.yml/badge.svg)](https://github.com/fny/xorcist/actions/workflows/test.yml)\n\nBlazing-fast-cross-platform-monkey-patch-free string XOR. Yes, that means JRuby too.\n\nSupported platforms: MRI (v2+), JRuby (v9.2+), Truffle (v21+), Truffle+GraalVM (v21+).\n\n## Usage\n\n```ruby\nrequire 'xorcist'\n\na, b = 'a', 'b'\nXorcist.xor(a, b) # =\u003e \"\\u0003\"\na # =\u003e 'a'\nXorcist.xor!(a, b) # =\u003e \"\\u0003\"\na # =\u003e \"\\u0003\"\nXorcist.xor!(a.freeze, b) # =\u003e RuntimeError!\n```\n\nYou can `include Xorcist` to expose its methods:\n\n```ruby\nrequire 'xorcist'\ninclude Xorcist\n\na, b = 'a', 'b'\nxor(a, b)\nxor!(a, b)\n```\n\nRefinements on `String` are also available:\n\n```ruby\nrequire 'xorcist'\nrequire 'xorcist/refinements'\nusing Xorcist::Refinements\n\na, b = 'a', 'b'\na.xor(b)\na.xor!(b)\n```\n\nNote: Refinements will not work in [JRuby 9.2.6](https://github.com/jruby/jruby/issues/5288) and below. This isn't an issue for earlier versions of JRuby 9.0-9.1 or JRuby 9.2.7+.\n\nYou can also monkey patch `String` if you're into that:\n\n```ruby\nrequire 'xorcist'\nrequire 'xorcist/string_methods'\nString.include(Xorcist::StringMethods)\n```\n\n## Encodings\n\nNote the precise encoding `xor`'s output is undefined in the v1.0-1.x releases. In MRI `xor!` will return a string using your default encoding. With JRuby, `xor!` will return an ASCII-8BIT string.\n\n## Benchmarks\n\nRun from my Macbook. Run 'em yourself with `bin/benchmark`. You'll need to have [`benchmark-ips`](https://github.com/evanphx/benchmark-ips) installed.\n\n### MRI\n\n```\nruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]\n\nWarming up --------------------------------------\n                ruby    91.478k i/100ms\n             xorcist     1.043M i/100ms\nCalculating -------------------------------------\n                ruby    928.443k (± 2.0%) i/s -      4.665M in   5.026920s\n             xorcist     10.438M (± 1.4%) i/s -     53.187M in   5.096610s\n```\n\n### JRuby\n\n```\njruby 9.3.6.0 (2.6.8) 2022-06-27 7a2cbcd376 OpenJDK 64-Bit Server VM 18.0.2+0 on 18.0.2+0 +jit [arm64-darwin]\n\nWarming up --------------------------------------\n                ruby   236.487k i/100ms\n             xorcist   813.234k i/100ms\nCalculating -------------------------------------\n                ruby      2.673M (±11.0%) i/s -     13.243M in   5.025536s\n             xorcist     20.432M (±24.4%) i/s -     90.269M in   5.000974s\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'xorcist'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install xorcist\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/fny/xorcist.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n## Special Thanks To...\n\n - [Steve Sloan](http://www.finagle.org) for his [fast_xor gem](https://github.com/CodeMonkeySteve/fast_xor) from which most of the tests are borrowed\n - [James Coglan](http://jcoglan.com) for his [guide on writing a JRuby Java extension](https://blog.jcoglan.com/2012/08/02/your-first-ruby-native-extension-java/)\n - [Thomas Leitner](https://github.com/gettalong) for a faster pure Ruby XOR implementation that's used in the benchmark\n - [The JRuby Team](https://twitter.com/jruby) for their assistance in debugging various issues over the years\n - To all [contributers](https://github.com/fny/xorcist/graphs/contributors)! :beers:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffny%2Fxorcist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffny%2Fxorcist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffny%2Fxorcist/lists"}