go_secure 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/go_secure.rb +4 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6df2e5055235de7fb8e1f4ffa24f139f608d99da
4
- data.tar.gz: d324a65339e5f79aa7397ac3a70eb29595ed7330
3
+ metadata.gz: a1a6dc8c4d4b26c2ac18476a04b34cf0b3ce2ceb
4
+ data.tar.gz: 28d7f549d81126dee775fa8cca46354ac8dd43fb
5
5
  SHA512:
6
- metadata.gz: 3d9fe792505c3dc4a2aa70a5d28dd61d55962b8ed414ead63ca143e9e68e4b56a59c773ee1615551ce67212e15f94c61649cbb111fd4af3186b0126d26659de8
7
- data.tar.gz: 78dd5d713327f3dfcbbcd79582008a0b25a5d80b3aaa3de010ae1e4da6169abd03e38fbbff013aecd9cf7cb9799b24cd38468cd41e4be4269f9ecc83ca036326
6
+ metadata.gz: 91a50eb37028ef72bc809e34b3d6f98ec52cc3500fe1da0ff1dcf77a1d523cc6f31a4866bb6395664d15d97bc65d410ef5730237f6fa91c8fbd89e6dbe682a4f
7
+ data.tar.gz: 21d9d814e6c30f52a0646f79aa7742a789fcada13c87ef8395acc0043bc07e7693a995de3a78a225606fcd5ae7d140b4b23710b3832c56aa25f06595d02fc968
@@ -1,5 +1,6 @@
1
1
  require 'openssl'
2
2
  require 'base64'
3
+ require 'oj'
3
4
 
4
5
  module GoSecure
5
6
  def self.sha512(str, salt, encryption_key=nil)
@@ -134,15 +135,15 @@ module GoSecure
134
135
  def self.load(str)
135
136
  return nil unless str
136
137
  if str.match(/^\*\*/)
137
- JSON.load(str[2..-1])
138
+ Oj.load(str[2..-1])
138
139
  else
139
140
  salt, secret = str.split(/--/, 2)
140
- JSON.load(GoSecure.decrypt(secret, salt, "secure_json"))
141
+ Oj.load(GoSecure.decrypt(secret, salt, "secure_json"))
141
142
  end
142
143
  end
143
144
 
144
145
  def self.dump(obj)
145
- json = JSON.dump(obj)
146
+ json = Oj.dump(obj, mode: :compat)
146
147
  res = encrypted_dump(json)
147
148
  res
148
149
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_secure
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-20 00:00:00.000000000 Z
11
+ date: 2018-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec