From 1272510e6cd89a02ba7e94e22d795d91a22d4bac Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 31 May 2018 20:21:08 +0300 Subject: ugnich random -> commons-lang3 RandomStringUtils --- .../src/main/java/com/juick/service/UserServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'juick-server-jdbc/src/main/java/com/juick/service') diff --git a/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java index 3f7cebf6..a0a07fb3 100644 --- a/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java +++ b/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java @@ -21,8 +21,8 @@ import com.juick.User; import com.juick.server.helpers.AnonymousUser; import com.juick.server.helpers.Auth; import com.juick.server.helpers.UserInfo; -import com.juick.server.util.HashUtils; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.dao.DuplicateKeyException; import org.springframework.jdbc.core.RowMapper; @@ -299,7 +299,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { "SELECT hash FROM logins WHERE user_id = ?", String.class, uid); if (list.isEmpty()) { - String hash = HashUtils.generateHash(16); + String hash = RandomStringUtils.randomAlphanumeric(16).toUpperCase(); getJdbcTemplate().update("INSERT INTO logins(user_id, hash) VALUES (?, ?)", uid, hash); return hash; } -- cgit v1.2.3