Overview

Namespaces

  • CJPGDK
    • PhpHttpAuth
      • Database
      • Hash
  • PHP

Traits

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

Trait Md5

Provides PHP methods for MD5 hashing

this type of hasing is not supported by real htpasswd authentication added as a sample, and because it was need in an other project.

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/Md5.php
Methods summary
public string
# getMd5HtpasswdRow( 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
# createUserMd5( 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
# getMd5Hash( string $plainpasswd )

Get an md5 hash

Get an md5 hash

Parameters

$plainpasswd

Returns

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

Validate an md5 hash

Validate an md5 hash

Parameters

$plain
$hash

Returns

boolean
PhpHttpAuth API documentation generated by ApiGen