[Ruby on Rails] What is Bcrypt?

Introduction

What is Bcrypt?

Bcrypt A gem that provides a function for hashing passwords.

Gemfile


# gem 'bcrypt', '~> 3.1.7' 

↓ Remove the hash (#) and execute ** bundle install **.

Gemfile


gem 'bcrypt', '~> 3.1.7' 

What you can do with Bcrypt installed

-The has_secure_password method can be used. ・ The authenticate method can be used

Bcrypt::password.create("○○○○") Returns a hashed value of a character string (value in ○○○○).

:001:0> BCrypt::Password.create("foobar")
=> "$2a$12$W0qW0H5M2YRx2kyGdlBeMOS5cK11hbF8sT4.oKgWF6Aq43E6bjr0C"

Recommended Posts

[Ruby on Rails] What is Bcrypt?
Beginner Ruby on Rails What I learned is being summarized
Ruby on Rails Elementary
Ruby on Rails basics
Ruby On Rails Association
[Ruby] What is true?
Ruby on rails learning record -2020.10.03
What is a Ruby module?
What is Rails gem devise?
Ruby on rails learning record -2020.10.04
[Ruby on Rails] Debug (binding.pry)
Ruby on rails learning record -2020.10.05
Ruby on rails learning record -2020.10.09
Ruby on Rails config configuration
Ruby on Rails basic learning ①
[Ruby on Rails] about has_secure_password
Ruby on rails learning record-2020.10.07 ②
[Ruby] What is `!!` used for?
Commentary on partial! --Ruby on Rails
[Ruby] What is an instance?
Ruby on rails learning record-2020.10.07 ①
Cancel Ruby on Rails migration
Ruby on rails learning record -2020.10.06
Ruby on Rails validation summary
Ruby on Rails Basic Memorandum
What is Rails Active Record?
Ruby on Rails Overview (Beginner Summary)
[Ruby on Rails] Read try (: [],: key)
[Ruby on Rails] yarn install --check-files
Ruby on Rails variable, constant summary
[Ruby on Rails] Introduced paging function
Progate Ruby on Rails5 Looking Back
How to use Ruby on Rails
Ruby on Rails Japanese-English support i18n
(Ruby on Rails6) "Erase" posted content
[Ruby on Rails] CSV output function
Ruby on Rails 6.0 environment construction memo
[Ruby on Rails] Confirmation page creation
Ruby On Rails devise routing conflict
[Ruby on Rails] Comment function implementation
[Ruby on Rails] DM, chat function
[Ruby on Rails] Convenient helper method
What is a Ruby 2D array?
[Ruby on Rails] Stop "looping until ..."
[Ruby on Rails] Introduction of initial data
[Ruby on Rails] Search function (not selected)
[Rails] Addition of Ruby On Rails comment function
[Ruby on Rails] Creating an inquiry form
[Ruby on Rails] View test with RSpec
[Ruby on Rails] How to use CarrierWave
[Ruby on Rails] Code check using Rubocop-airbnb
[Ruby on Rails] 1 model CRUD (Routing Main)
[Technical memo] What is "include" in Ruby?
Ruby on Rails installation method [Mac edition]
[Ruby on Rails] model, controller terminal command
What is follow_redirect! Following ?: Rails Tutorial Memorandum-Chapter 7
Let's summarize "MVC" of Ruby on Rails
Ruby on Rails model creation / deletion command
[Ruby on Rails] About bundler (for beginners)
part of the syntax of ruby ​​on rails
Ruby on Rails6 Practical Guide cp7 ~ cp9 [Memo]