Module dauth.random

DAuth - Salted Hashed Password Library for D Random generators


Name Description
randomBytes numBytes must be a multiple of 4, or this will throw an Exception
randomPassword Generates a random password.
randomSalt Generates a random salt. Necessary for salting passwords.
randomToken Generates a random token. Useful for temporary one-use URLs, such as in email confirmations.

Global variables

Name Type Description
defaultPasswordChars immutable(ubyte)[] Punctuation is not included in generated passwords by default. Technically, this is slightly less secure for a given password length, but it prevents syntax-related bugs when a generated password is stored in a (properly-secured) text-based configuration file.
defaultPasswordLength int In characters. Default length of randomly-generated passwords.
defaultSaltLength int In bytes. Must be a multiple of 4.
defaultTokenStrength int In bytes of randomness, not length of token. Must be a multiple of 4. Although, due to usage of base64, using a multiple of 12 prevents a padding tilde from existing at the end of every token.
isDAuthRandom void