4 ms·
Alternatively, Go's bcrypt implementation has a very simple API: hash, err := bcrypt.GenerateFromPassword([]byte(password), 10) err := CompareHashAndP
by elithrar 13y ago
Alternatively, Go's bcrypt implementation has a very simple API:
hash, err := bcrypt.GenerateFromPassword([]byte(password), 10)
err := CompareHashAndPassword(hash, []byte(password))
There's also a Cost(hash) function that you can leverage to re-hash passwords with a higher cost.