lynndylanhurley / devise_token_auth

Token based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth.
Do What The F*ck You Want To Public License
3.52k stars 1.14k forks source link

Why BCrypt? #1595

Open diogob opened 1 year ago

diogob commented 1 year ago

From what I could gather from the library code and docs the tokens are generated with a good source of entropy and do have a fixed lifestyle. Taking this into account wouldn't make more sense to use a fast hashing algorithm such as sha-2 ?

This would greatly lower the computational cost without any sacrifice of security. Or am I missing something?