Skip to content

Commit f293a0d

Browse files
committed
Fix example of Crypto::BCrypt.new(String, String, Int).
1 parent 34875ff commit f293a0d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/crypto/bcrypt.cr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ class Crypto::Bcrypt
7272

7373
# Creates a new `Crypto::Bcrypt` object from the given *password* with *salt* and *cost*.
7474
#
75+
# *salt* must be a base64 encoded string of 16 bytes (128 bits).
76+
#
7577
# ```
7678
# require "crypto/bcrypt"
7779
#
78-
# password = Crypto::Bcrypt.new "secret", "salt_of_16_chars"
80+
# password = Crypto::Bcrypt.new "secret", "0102030405060708090a0b0c0d0e0f10"
7981
# password.digest
8082
# ```
8183
def self.new(password : String, salt : String, cost = DEFAULT_COST)

0 commit comments

Comments
 (0)