class Hash (View source)

Methods

static string
make(string $password, int $cost = 10)

Buat hash password.

static bool
check(string $password, string $hash)

Cek cocok atau tidaknya sebuah password dengan hashnya.

static bool
weak(string $hash, int $cost = 10)

Cek apakah hash yang dihasilkan masih lemah berdasarkan cost yang diberikan.

Details

static string make(string $password, int $cost = 10)

Buat hash password.

Method ini diadaptasi dari https://github.com/ircmaxell/password-compat.

Parameters

string $password
int $cost

Return Value

string

static bool check(string $password, string $hash)

Cek cocok atau tidaknya sebuah password dengan hashnya.

Method ini diadaptasi dari https://github.com/ircmaxell/password-compat.

Parameters

string $password
string $hash

Return Value

bool

static bool weak(string $hash, int $cost = 10)

Cek apakah hash yang dihasilkan masih lemah berdasarkan cost yang diberikan.

Method ini diadaptasi dari https://github.com/ircmaxell/password-compat.

Parameters

string $hash
int $cost

Return Value

bool