Commit 0bda454dcefd1eed459b7f29b0327fd36609cf14
Ok, RDoc doesn't like pretty comments.
git-svn-id: http://bcrypt-ruby.rubyforge.org/svn/trunk@14 b1e0f299-433e-4bb3-9895-84128a6cfb6acodahale committed on 2/28/2007, 8:13:16 AM
Parent: 8b90c357e99debc6e49cef5bf027c1034d12a097
Files changed
lib/bcrypt.rb | changed |
lib/bcrypt.rb | ||
---|---|---|
@@ -14,10 +14,12 @@ | ||
14 | 14 … | end |
15 | 15 … | |
16 | 16 … | # A Ruby wrapper for the bcrypt() extension calls. |
17 | 17 … | class Engine |
18 | - DEFAULT_COST = 10 # The default computational expense parameter. | |
19 | - MAX_SALT_LENGTH = 16 # Maximum possible size of bcrypt() salts. | |
18 … | + # The default computational expense parameter. | |
19 … | + DEFAULT_COST = 10 | |
20 … | + # Maximum possible size of bcrypt() salts. | |
21 … | + MAX_SALT_LENGTH = 16 | |
20 | 22 … | |
21 | 23 … | # C-level routines which, if they don't get the right input, will crash the |
22 | 24 … | # hell out of the Ruby process. |
23 | 25 … | private_class_method :__bc_salt |
@@ -90,12 +92,16 @@ | ||
90 | 92 … | # @db_password == "my grand secret" #=> true |
91 | 93 … | # @db_password == "a paltry guess" #=> false |
92 | 94 … | # |
93 | 95 … | class Password < String |
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. | |
96 … | + # The hash portion of the stored password hash. | |
97 … | + attr_reader :hash | |
98 … | + # The salt of the store password hash (including version and cost). | |
99 … | + attr_reader :salt | |
100 … | + # The version of the bcrypt() algorithm used to create the hash. | |
101 … | + attr_reader :version | |
102 … | + # The cost factor used to create the hash. | |
103 … | + attr_reader :cost | |
98 | 104 … | |
99 | 105 … | class << self |
100 | 106 … | # Hashes a secret, returning a BCrypt::Password instance. Takes an optional <tt>:cost</tt> option, which is a |
101 | 107 … | # logarithmic variable which determines how computational expensive the hash is to calculate (a <tt>:cost</tt> of |
Built with git-ssb-web