jjn1056 / DBIx-Class-BcryptColumn

Hash a value using bcrypt on insert / update

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add prehashed support

Leont opened this issue · comments

The latest version of Crypt::Bcrypt supports pre-hashed passwords out of the box (and importantly does so in a what that is resistant to password shunking). You can use the bcrypt_prehashed and bcrypt_check_prehashed functions. Note that if $hash_algorithm is an empty string it does a plain old bcrypt, so you can just add an attribute to your module that defaults to that and pass it on without having to worry about any other the other details.