Commit 024b702838a0d932e17d91cbd0a1c939c9c3a296
Cleaned up the comments a bit.
git-svn-id: http://bcrypt-ruby.rubyforge.org/svn/trunk@12 b1e0f299-433e-4bb3-9895-84128a6cfb6acodahale committed on 2/28/2007, 6:35:58 AM
Parent: b53ba3beeb9cfd520ffe210bc37fed33fe4407da
Files changed
lib/bcrypt.rb | changed |
lib/bcrypt.rb | ||
---|---|---|
@@ -7,14 +7,11 @@ | ||
7 | 7 … | # A Ruby library implementing OpenBSD's bcrypt()/crypt_blowfish algorithm for |
8 | 8 … | # hashing passwords. |
9 | 9 … | module BCrypt |
10 | 10 … | module Errors # :nodoc: |
11 | - # The salt parameter provided to bcrypt() is invalid. | |
12 | - class InvalidSalt < Exception; end | |
13 | - # The hash parameter provided to bcrypt() is invalid. | |
14 | - class InvalidHash < Exception; end | |
15 | - # The cost parameter provided to bcrypt() is invalid. | |
16 | - class InvalidCost < Exception; end | |
11 … | + class InvalidSalt < Exception; end # The salt parameter provided to bcrypt() is invalid. | |
12 … | + class InvalidHash < Exception; end # The hash parameter provided to bcrypt() is invalid. | |
13 … | + class InvalidCost < Exception; end # The cost parameter provided to bcrypt() is invalid. | |
17 | 14 … | end |
18 | 15 … | |
19 | 16 … | # A Ruby wrapper for the bcrypt() extension calls. |
20 | 17 … | class Engine |
@@ -93,16 +90,12 @@ | ||
93 | 90 … | # @db_password == "my grand secret" #=> true |
94 | 91 … | # @db_password == "a paltry guess" #=> false |
95 | 92 … | # |
96 | 93 … | class Password < String |
97 | - # The hash portion of the stored password hash. | |
98 | - attr_reader :hash | |
99 | - # The salt of the store password hash (including version and cost). | |
100 | - attr_reader :salt | |
101 | - # The version of the bcrypt() algorithm used to create the hash. | |
102 | - attr_reader :version | |
103 | - # The cost factor used to create the hash. | |
104 | - attr_reader :cost | |
94 … | + attr_reader :hash # The hash portion of the stored password hash. | |
95 … | + attr_reader :salt # The salt of the store password hash (including version and cost). | |
96 … | + attr_reader :version # The version of the bcrypt() algorithm used to create the hash. | |
97 … | + attr_reader :cost # The cost factor used to create the hash. | |
105 | 98 … | |
106 | 99 … | class << self |
107 | 100 … | # Hashes a secret, returning a BCrypt::Password instance. Takes an optional <tt>:cost</tt> option, which is a |
108 | 101 … | # logarithmic variable which determines how computational expensive the hash is to calculate (a <tt>:cost</tt> of |
Built with git-ssb-web