A
A
Andrey Myvrenik2015-03-20 13:46:47
Java
Andrey Myvrenik, 2015-03-20 13:46:47

Is there a method in Java SE/EE for hashing a string using, for example, the SHA algorithm?

Is it in the standard Java SE/EE packages? What algorithms are available? If not, what do people use to solve such problems?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2015-03-20
@gim0

docs.oracle.com/javase/8/docs/api/java/security/Me...

Y
yuraminsk, 2015-03-20
@yuraminsk

or via Spring Security
like BCrypt

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
  //...
  String password = "123456";
  PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
  String hashedPassword = passwordEncoder.encode(password);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question