Documentation ¶
Index ¶
- func Argon2IDHashCompare(s, hash string) (bool, error)
- func Argon2IDHashString(s string, config *Argon2IDConfig) (string, error)
- func CardTextIsValid(text string) bool
- func DeckCardAmountValid(amountWhiteCards, amountBlackCards int) bool
- func GetBlankCount(text string) int
- func MeetsPasswordRequirements(password string) bool
- type Argon2IDConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Argon2IDHashCompare ¶
Compares the supplied string with that hash.
func Argon2IDHashString ¶
func Argon2IDHashString(s string, config *Argon2IDConfig) (string, error)
Uses Argon2ID to hash the supplied string with the supplied config. It generates a random salt. Acts as a public-facing wrapper around argon2idHashStringWithSalt.
func CardTextIsValid ¶
A card is only valid if it has fewer than 101 characters and at least 1 character. If one card of the deck does not follow this rules, the deck won't be valid.
func DeckCardAmountValid ¶
Checks if the card amount for one deck is valid. This is the case if the deck has at most 500 cards in total. Additionally, there have to be at least 5 white and 5 black cards.
func GetBlankCount ¶
Returns the amount of blanks found in a text. A blank counts as a blank when it consists of 4 or more underscores (_) that are not separated. The blank ends after the first character that is not an underscore. When no blank was found the blank count is 1. This is because it will likely be a question or something similar.
func MeetsPasswordRequirements ¶
Checks if a password meets the password requirements. These are: - At least 8 characters long
Types ¶
type Argon2IDConfig ¶
func GetDefaultArgon2IDConfig ¶
func GetDefaultArgon2IDConfig() *Argon2IDConfig
Returns the default Argon2ID config used for hashing the password. For more information on why these parameters are used, see the comments of the argon2.IDKey function. At the time of writing this, it was recommended by this draft RFC: https://tools.ietf.org/html/draft-irtf-cfrg-argon2-03#section-9.3