Overview

Namespaces

  • CJPGDK
    • PhpHttpAuth
      • Database
      • Hash
  • PHP

Traits

  • Apr1Md5
  • Bcrypt
  • Md5
  • Sha
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Trait Bcrypt

Provides PHP methods for Bcrypt hashing (PHP version 5.5 and up)

Direct Known Users

CJPGDK\PhpHttpAuth\HttpAuth
Namespace: CJPGDK\PhpHttpAuth\Hash
Package: CJPGDK\PhpHttpAuth
Author: Christian M. Jensen cmj@cjpg.dk
Version: 1.0.0
Since: 1.0.0
Located at src/CJPGDK/PhpHttpAuth/Hash/Bcrypt.php
Methods summary
public string
# getBcryptHtpasswdRow( array|string $user, null|string $hashedpwd = null )

format username and password array to a '.htpasswd' line

format username and password array to a '.htpasswd' line

Parameters

$user
as array ['username' => , 'password'=>], or a user name with passwd
$hashedpwd

Returns

string
public array
# createUserBcrypt( string $user, string $pwd )

Create a user and password row.

Create a user and password row.

Parameters

$user
$pwd

Returns

array
['username' => , 'password'=>]
public string
# getBcryptHash( string $plainpasswd )

Get an bcrypt hash

Get an bcrypt hash

Parameters

$plainpasswd

Returns

string
public boolean
# matchBcryptHash( string $plain, string $hash )

Validate an bcrypt hash

Validate an bcrypt hash

Parameters

$plain
$hash

Returns

boolean
PhpHttpAuth API documentation generated by ApiGen