gsd 2 years ago
parent
commit
e594e6a5ad
  1. 8
      src/main/java/app/utils/SaltedCookie.java

8
src/main/java/app/utils/SaltedCookie.java

@ -4,6 +4,7 @@ import app.updates.CountriesUpdater;
import jakarta.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils;
@ -16,10 +17,15 @@ public class SaltedCookie {
@Value("${backend.auth.salt}")
private String salt;
private HashMap<String, String> secret_keys = new HashMap<>();
private HashMap<String, String> secret_keys;
private final Logger logger = LoggerFactory.getLogger(SaltedCookie.class);
@Autowired
public SaltedCookie() {
secret_keys = new HashMap<>();
}
public String Hashed(String value) {
return DigestUtils.md5DigestAsHex(String.format("%s+%s", value, salt).getBytes());
}

Loading…
Cancel
Save