All Projects → fny → xorcist

fny / xorcist

Licence: MIT license
Blazing-fast-cross-platform-monkey-patch-free string XOR

Programming Languages

ruby
36898 projects - #4 most used programming language
java
68154 projects - #9 most used programming language
c
50402 projects - #5 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to xorcist

Scorched earth
Scorched Earth clone in JRuby with no dependencies.
Stars: ✭ 126 (+270.59%)
Mutual labels:  jruby
enough mail
IMAP, POP3 and SMTP clients for Dart developers. Contains both low level as well as a high level API.
Stars: ✭ 78 (+129.41%)
Mutual labels:  encodings
warm-blanket
Ruby gem for warming up web services on boot
Stars: ✭ 1 (-97.06%)
Mutual labels:  jruby
Logstash
Logstash - transport and process your logs, events, or other data
Stars: ✭ 12,543 (+36791.18%)
Mutual labels:  jruby
Logstash Output Jdbc
JDBC output for Logstash
Stars: ✭ 230 (+576.47%)
Mutual labels:  jruby
JRubyArt
JRubyArt a ruby implementation of processing
Stars: ✭ 87 (+155.88%)
Mutual labels:  jruby
Embulk Output Bigquery
Embulk output plugin to load/insert data into Google BigQuery
Stars: ✭ 99 (+191.18%)
Mutual labels:  jruby
immutables-vavr
Immutables encodings for Vavr
Stars: ✭ 32 (-5.88%)
Mutual labels:  encodings
rubircd
💬 An IRC server written in Ruby
Stars: ✭ 23 (-32.35%)
Mutual labels:  jruby
jruby-openssl
JRuby's OpenSSL gem
Stars: ✭ 39 (+14.71%)
Mutual labels:  jruby
Glimmer
DSL Framework consisting of a DSL Engine and a Data-Binding Library used in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), Glimmer DSL for Opal (Pure Ruby Web GUI), Glimmer DSL for XML (& HTML), Glimmer DSL for CSS, and Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)
Stars: ✭ 186 (+447.06%)
Mutual labels:  jruby
Archivesspace
The ArchivesSpace archives management tool
Stars: ✭ 230 (+576.47%)
Mutual labels:  jruby
hawkfx
Hawkular explorer written in (J)Ruby with a JavaFX frontend.
Stars: ✭ 14 (-58.82%)
Mutual labels:  jruby
Ruby Install
Installs Ruby, JRuby, Rubinius, TruffleRuby or MRuby
Stars: ✭ 1,651 (+4755.88%)
Mutual labels:  jruby
characteristics
Character info under different encodings
Stars: ✭ 25 (-26.47%)
Mutual labels:  encodings
Shoes4
Shoes 4 : the next version of Shoes
Stars: ✭ 1,509 (+4338.24%)
Mutual labels:  jruby
glimmer-cs-gladiator
Gladiator (Glimmer Editor) - Glimmer Custom Shell
Stars: ✭ 26 (-23.53%)
Mutual labels:  jruby
glimmer-dsl-swt
Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
Stars: ✭ 53 (+55.88%)
Mutual labels:  jruby
proxy fetcher
💪 Ruby / JRuby / TrufflleRuby gem & CLI for dealing with proxy lists from various sources
Stars: ✭ 119 (+250%)
Mutual labels:  jruby
haskell-church-encodings
🌀 Church encodings written in Haskell
Stars: ✭ 23 (-32.35%)
Mutual labels:  encodings

Xorcist 👻

Gem Version Build Status

Blazing-fast-cross-platform-monkey-patch-free string XOR. Yes, that means JRuby too.

Usage

require 'xorcist'

a, b = 'a', 'b'
Xorcist.xor(a, b) # => "\u0003"
a # => 'a'
Xorcist.xor!(a, b) # => "\u0003"
a # => "\u0003"
Xorcist.xor!(a.freeze, b) # => RuntimeError!

You can include Xorcist to expose its methods:

require 'xorcist'
include Xorcist

a, b = 'a', 'b'
xor(a, b)
xor!(a, b)

Refinements on String are also available:

require 'xorcist'
require 'xorcist/refinements'
using Xorcist::Refinements

a, b = 'a', 'b'
a.xor(b)
a.xor!(b)

Note: Refinements will not work in JRuby 9.2.6 and below. This isn't an issue for earlier versions of JRuby 9.0-9.1 or JRuby 9.2.7.

You can also monkey patch String if you're into that:

require 'xorcist'
require 'xorcist/string_methods'
String.include(Xorcist::StringMethods)

Encodings

Note 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.

Security

Xorcist is cryptographically signed. To be sure the gem you install hasn’t been tampered with:

Add my public key as a trusted certificate:

gem cert --add <(curl -Ls https://raw.github.com/fny/xorcist/master/certs/fny.pem)

Then install the gem:

gem install xorcist -P HighSecurity

Checksums for all versions are also included in the checksums directory.

Benchmarks

Disclaimer: these are run from my craptop. Run 'em yourself with bin/benchmark. You'll need to have benchmark-ips installed.

MRI 2.2.1

Calculating -------------------------------------
                ruby    26.378k i/100ms
             xorcist    73.291k i/100ms
-------------------------------------------------
                ruby    376.513k (± 0.5%) i/s -      1.899M
             xorcist      2.150M (± 3.9%) i/s -     10.774M

JRuby 1.7.19

Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Calculating -------------------------------------
                ruby    31.795k i/100ms
             xorcist   118.084k i/100ms
-------------------------------------------------
                ruby    978.078k (±11.2%) i/s -      4.801M
             xorcist      3.897M (±14.1%) i/s -     19.012M

Installation

Add this line to your application's Gemfile:

gem 'xorcist'

And then execute:

$ bundle

Or install it yourself as:

$ gem install xorcist

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/fny/xorcist. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Special Thanks To...

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].