github.com/goravel/framework@v1.13.9/hash/application.go (about)

     1  package hash
     2  
     3  import (
     4  	"github.com/goravel/framework/contracts/config"
     5  	"github.com/goravel/framework/contracts/hash"
     6  )
     7  
     8  const (
     9  	DriverBcrypt string = "bcrypt"
    10  )
    11  
    12  type Application struct {
    13  }
    14  
    15  func NewApplication(config config.Config) hash.Hash {
    16  	driver := config.GetString("hashing.driver", "argon2id")
    17  
    18  	if driver == DriverBcrypt {
    19  		return NewBcrypt(config)
    20  	}
    21  
    22  	return NewArgon2id(config)
    23  }