rmega 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/rmega/session.rb CHANGED
@@ -31,7 +31,7 @@ module Rmega
31
31
  end
32
32
 
33
33
  def login(password)
34
- uh = Crypto.stringhash Crypto.prepare_key_pw(password), email
34
+ uh = Crypto.stringhash Crypto.prepare_key_pw(password), email.downcase
35
35
  resp = request(a: 'us', user: email, uh: uh)
36
36
 
37
37
  # Decrypts the master key
data/lib/rmega/utils.rb CHANGED
@@ -3,9 +3,9 @@ module Rmega
3
3
  extend self
4
4
 
5
5
  def str_to_a32(string)
6
- pad_to = string.bytesize + ((string.bytesize) % 4)
7
- string = string.ljust pad_to, "\x00"
8
- string.unpack 'l>*'
6
+ size = (string.bytesize + 3) >> 2
7
+ string = string.ljust (string.bytesize + 3), "\x00"
8
+ string.unpack "l>#{size}"
9
9
  end
10
10
 
11
11
  def a32_to_str(a32, len = nil)
data/lib/rmega/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rmega
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmega
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-14 00:00:00.000000000 Z
12
+ date: 2013-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry