Atom Framework
Go to Github
v1.0.0
v1.0.0
  • Installation
  • Getting Started
  • Configuration
    • Environment
    • Authentication
  • Basics
    • Routing
    • Middleware
    • Controllers
    • Models
    • Requests
    • Views
    • URL Generation
    • Session
  • Misc
    • Security
      • Encryption
      • Hashing
    • Storage
    • Moment
Propulsé par GitBook

© 2025 Licon Corp

Sur cette page
  • Basic Usage
  • Verifying A Password Against A Hash

Cet article vous a-t-il été utile ?

  1. Misc
  2. Security

Hashing

The Atom Hash facade, hash_make and hash_check provides secure Bcrypt and Argon2 hashing for storing user passwords.

Bcrypt is a great choice for hashing passwords because its "work factor" is adjustable, which means that the time it takes to generate a hash can be increased as hardware power increases.

Basic Usage

You may hash a password by calling the make method on the Hash facade or by using the hash_make helper:

$user = App\Models\User::find(1);

$user->password = Hash::make('my_password');

$user->password = hash_make('using helper');

Verifying A Password Against A Hash

The check or hash_check methods allows you to verify that a given plain-text string corresponds to a given hash:

if(Hash::check('plain-text', $hashedPassword)) {
    // The passwords match...
}

if(hash_check('plain-text', $hashedPassword)) {
    // The passwords match...
}
PrécédentEncryptionSuivantStorage

Dernière mise à jour il y a 6 ans

Cet article vous a-t-il été utile ?