가 제공하는 사용자 정의 해본 클래스를 만들어야합니다.
class SHAHasher implements Illuminate\Hashing\HasherInterface {
public function make($value) {
return hash('sha1', $value);
}
public function check($value, $hashedValue) {
return $this->make($value) === $hashedValue;
}
public function needsRehash($hashedValue) {
return false;
}
}
Directory.
class SHAHashServiceProvider extends Illuminate\Support\ServiceProvider {
public function register() {
$this->app['hash'] = $this->app->share(function () {
return new SHAHasher();
});
}
}
응용 프로그램 구성 업데이트
'Illuminate\Hashing\HashServiceProvider',
'SHAHashServiceProvider',
Conclusion
By following these steps, you can effectively use SHA1 encryption instead of BCrypt in Laravel 4. This allows you to integrate your application with legacy systems or external services that require SHA1 응용 프로그램에 대한 안전한 해싱 메커니즘을 유지하는 동안 인증.
부인 성명: 제공된 모든 리소스는 부분적으로 인터넷에서 가져온 것입니다. 귀하의 저작권이나 기타 권리 및 이익이 침해된 경우 자세한 이유를 설명하고 저작권 또는 권리 및 이익에 대한 증거를 제공한 후 이메일([email protected])로 보내주십시오. 최대한 빨리 처리해 드리겠습니다.
Copyright© 2022 湘ICP备2022001581号-3