DBIx::...Bcrypt(3pm)

πŸ“¦
version 0.00020 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

🌈 NAME 🌈

Welcome to the DBIx::...Bcrypt(3pm) page β€” yes, a User Contributed Perl Documentation page, bestie. The full module name is DBIx::Class::EncodedColumn::Crypt::Eksblowfish::Bcrypt, and it's the Eksblowfish bcrypt backend. πŸ’…βœ¨


πŸ¦‹ SYNOPSYS πŸ¦‹

Okay so here's the setup exactly as the page says β€” Eksblowfish bcrypt, cost of 8, no key_nul, and generate the check method:

#Eksblowfish bcrypt / cost of 8/ no key_nul / generate check method
__PACKAGE__->add_columns(
  'password' => {
    data_type => 'CHAR',
    size      => 59,
    encode_column => 1,
    encode_class  => 'Crypt::Eksblowfish::Bcrypt',
    encode_args   => { key_nul => 0, cost => 8 },
    encode_check_method => 'check_password',
}

πŸ’– DESCRIPTION πŸ’–

The original page literally puts no extra prose under DESCRIPTION, so we're going straight to the accepted arguments. No cap, that's the whole vibe here. 🫢


✨ ACCEPTED ARGUMENTS ✨

πŸŽ€ key_nul => [01] πŸŽ€

Defaults to true.

From the Crypt::Eksblowfish::Bcrypt docs:

Boolean: whether to append a NUL to the password before using it as a key. The algorithm as originally devised does not do this, but it was later modified to do it. The version that does append NUL is to be preferred; not doing so is supported only for backward compatibility.

πŸ“ cost => \d\d? πŸ“

A single- or double-digit non-negative integer representing the cost of the hash function. Defaults to 8. πŸ’Έ


πŸ”₯ METHODS πŸ”₯

πŸ’– make_encode_sub $column_name, \%encode_args πŸ’–

Returns a coderef that accepts a plaintext value and returns an encoded value. Feed it plaintext, get encoded value back. Slay. ✨

πŸ’œ make_check_sub $column_name, \%encode_args πŸ’œ

Returns a coderef that, when given the row object and a plaintext value, will return a boolean if the plaintext matches the encoded value. This is typically used for password authentication. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

  • DBIx::Class::EncodedColumn::Digest
  • DBIx::Class::EncodedColumn
  • Crypt::Eksblowfish::Bcrypt

πŸŽ€ AUTHOR πŸŽ€

Guillermo Roditi (groditi) groditi@cpan.org

Based on the Vienna WoC ToDo manager code by Matt S trout (mst)


πŸ’œ LICENSE πŸ’œ

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


Okay bestie, that's the whole page β€” signing off from perl v5.40.1, dated 2025-04-01, on DBIx::...Bcrypt(3pm). πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from