unix-crypt 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/unix_crypt.rb +2 -1
  2. metadata +6 -6
@@ -18,6 +18,7 @@ module UnixCrypt
18
18
  protected
19
19
  def self.base64encode(input)
20
20
  b64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
21
+ input = input.bytes.to_a
21
22
  output = ""
22
23
  byte_indexes.each do |i3, i2, i1|
23
24
  b1, b2, b3 = i1 && input[i1] || 0, i2 && input[i2] || 0, i3 && input[i3] || 0
@@ -94,7 +95,7 @@ module UnixCrypt
94
95
  dp = digest.digest(password * password.length)
95
96
  p = dp * (password.length/length) + dp[0...password.length % length]
96
97
 
97
- ds = digest.digest(salt * (16 + a[0]))
98
+ ds = digest.digest(salt * (16 + a.bytes.first))
98
99
  s = ds * (salt.length/length) + ds[0...salt.length % length]
99
100
 
100
101
  rounds.times do |index|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unix-crypt
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
4
+ hash: 21
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roger Nesbitt
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-15 00:00:00 +13:00
18
+ date: 2012-02-01 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  requirements: []
61
61
 
62
62
  rubyforge_project:
63
- rubygems_version: 1.3.7
63
+ rubygems_version: 1.6.2
64
64
  signing_key:
65
65
  specification_version: 3
66
66
  summary: Performs the UNIX crypt(3) algorithm using DES, MD5, SHA256 or SHA512