Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
Update documentation with details from PHC string format definition
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbuker committed Apr 10, 2021
1 parent 58b3588 commit 4d2990e
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/argon2/password.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,25 @@ class Password
# Used to validate the maximum acceptable parallelism cost
MAX_P_COST = 8
# The complete Argon2 digest string (not to be confused with the checksum).
#
# For a detailed description of the digest format, please see:
# https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md
attr_reader :digest
# The hash portion of the stored password hash.
# The hash portion of the stored password hash. This is Base64 encoded by
# default.
attr_reader :checksum
# The salt of the stored password hash.
# The salt of the stored password hash. This is Base64 encoded by default.
#
# To retrieve the original salt:
#
# require 'base64'
#
# argon2 = Argon2::Password.new(digest)
#
# argon2.salt
# => Base64 encoded salt
# Base64.decode64(argon2.salt)
# => original salt
attr_reader :salt
# Variant used (argon2i / argon2d / argon2id)
attr_reader :variant
Expand Down

0 comments on commit 4d2990e

Please sign in to comment.