more prep work for jRuby

This commit is contained in:
Sam 2018-02-26 10:25:58 +11:00
parent 79e0cd7f52
commit b301c9f6c1
2 changed files with 6 additions and 5 deletions

View File

@ -49,9 +49,10 @@ gem 'message_bus'
gem 'rails_multisite' gem 'rails_multisite'
gem 'fast_xs' gem 'fast_xs', platform: :mri
gem 'fast_xor' # may move to xorcist post: https://github.com/fny/xorcist/issues/4
gem 'fast_xor', platform: :mri
gem 'fastimage' gem 'fastimage'
@ -141,7 +142,7 @@ end
# this is an optional gem, it provides a high performance replacement # this is an optional gem, it provides a high performance replacement
# to String#blank? a method that is called quite frequently in current # to String#blank? a method that is called quite frequently in current
# ActiveRecord, this may change in the future # ActiveRecord, this may change in the future
gem 'fast_blank' gem 'fast_blank', platform: :mri
# this provides a very efficient lru cache # this provides a very efficient lru cache
gem 'lru_redux' gem 'lru_redux'
@ -155,7 +156,7 @@ gem 'htmlentities', require: false
gem 'flamegraph', require: false gem 'flamegraph', require: false
gem 'rack-mini-profiler', require: false gem 'rack-mini-profiler', require: false
gem 'unicorn', require: false gem 'unicorn', require: false, platform: :mri
gem 'puma', require: false gem 'puma', require: false
gem 'rbtrace', require: false, platform: :mri gem 'rbtrace', require: false, platform: :mri
gem 'gc_tracer', require: false, platform: :mri gem 'gc_tracer', require: false, platform: :mri

View File

@ -31,7 +31,7 @@ class Pbkdf2
# fallback xor in case we need it for jruby ... way slower # fallback xor in case we need it for jruby ... way slower
def self.xor(x, y) def self.xor(x, y)
x.bytes.zip(y.bytes).map { |x, y| x ^ y }.pack('c*') x.bytes.zip(y.bytes).map { |a, b| a ^ b }.pack('c*')
end end
def self.prf(hash_function, password, data) def self.prf(hash_function, password, data)