diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-29 21:28:21 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-29 21:28:21 +0200 |
commit | 927333f4f89403c5a6a2b421065112e517d88193 (patch) | |
tree | 1767e142ee9263b5b6968b5b43228ee0889232c5 /app/controllers/xrd_controller.rb | |
parent | e4aebad35afae12f4b7503fb6c3783fcd3809761 (diff) |
Improve code style
Diffstat (limited to 'app/controllers/xrd_controller.rb')
-rw-r--r-- | app/controllers/xrd_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/xrd_controller.rb b/app/controllers/xrd_controller.rb index 1e39a3e4c..9201eb6c1 100644 --- a/app/controllers/xrd_controller.rb +++ b/app/controllers/xrd_controller.rb @@ -31,9 +31,9 @@ class XrdController < ApplicationController def pem_to_magic_key(public_key) modulus, exponent = [public_key.n, public_key.e].map do |component| - result = "" + result = '' - until component == 0 do + until component.zero? result << [component % 256].pack('C') component >>= 8 end @@ -41,7 +41,7 @@ class XrdController < ApplicationController result.reverse! end - (["RSA"] + [modulus, exponent].map { |n| Base64.urlsafe_encode64(n) }).join('.') + (['RSA'] + [modulus, exponent].map { |n| Base64.urlsafe_encode64(n) }).join('.') end def resource_param |