Documentation ¶
Index ¶
- Constants
- func BytesSha256(v []byte) string
- func StrSha256(v string) string
- type PassHash
- func HashPassword(plainpass string, totpSecret []byte) (PassHash, error)
- func HashPasswordV0(plainpass string) (PassHash, error)
- func HashPasswordV1(plainpass string) (PassHash, error)
- func HashPasswordV2(plainpass string) (PassHash, error)
- func HashPasswordV3(plainpass string, totpSecret []byte) (PassHash, error)
- func HashPasswordV4(plainpass string, totpSecret []byte) (PassHash, error)
- func (ph PassHash) Change(newPlainPass string) (PassHash, error)
- func (ph PassHash) ClearTOTP() (PassHash, error)
- func (ph PassHash) Data() (_version int, _seed []byte, _payload []byte, _totp bool, _totpsecret []byte, ...)
- func (ph PassHash) HasTOTP() bool
- func (ph PassHash) NeedsPasswordUpgrade() bool
- func (ph PassHash) String() string
- func (ph PassHash) Upgrade(plainpass string) (PassHash, error)
- func (ph PassHash) Valid() bool
- func (ph PassHash) Verify(plainpass string, totp *string) bool
- func (ph PassHash) WithTOTP(totpSecret []byte) (PassHash, error)
Constants ¶
View Source
const LatestPassHashVersion = 4
Variables ¶
This section is empty.
Functions ¶
func BytesSha256 ¶
Types ¶
type PassHash ¶ added in v0.0.47
type PassHash string
PassHash - [v0]: plaintext password ( `0|...` ) - [v1]: sha256(plaintext) - [v2]: seed | sha256<seed>(plaintext) - [v3]: seed | sha256<seed>(plaintext) | [hex(totp)] - [v4]: bcrypt(plaintext) | [hex(totp)]
func HashPassword ¶ added in v0.0.47
func HashPasswordV0 ¶ added in v0.0.47
func HashPasswordV1 ¶ added in v0.0.47
func HashPasswordV2 ¶ added in v0.0.47
func HashPasswordV3 ¶ added in v0.0.47
func HashPasswordV4 ¶ added in v0.0.47
func (PassHash) NeedsPasswordUpgrade ¶ added in v0.0.47
Click to show internal directories.
Click to hide internal directories.