API Documentation for: 1.1.1
Show:

PasswordUtils Class

Namespace: Canteen\Utilities

Utilities for managing the user password. Located in the namespace Canteen\Utilities.

Item Index

Methods

Methods

hash

(
  • password
)
String static

Takes a password and returns the salted hash

Parameters:

  • password String

    The plain text password to hash

Returns:

String:

The hash of the password (128 hex characters)

validate

(
  • password
  • correctHash
)
Boolean static

Validates a password returns true if hash is the correct hash for that password

Parameters:

  • password String

    The plain text password to check

  • correctHash String

    The password hash to compare against (from database)

Returns:

Boolean:

If the password is valid, false otherwise.