diff options
author | Vitaly Takmazov | 2018-05-31 20:21:08 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-05-31 20:21:08 +0300 |
commit | 1272510e6cd89a02ba7e94e22d795d91a22d4bac (patch) | |
tree | dc6f36cb11c1434214cd7957c267c404c9e12896 /juick-server-jdbc | |
parent | 485600a958c13707e9a1d4940e254f449ecab8ca (diff) |
ugnich random -> commons-lang3 RandomStringUtils
Diffstat (limited to 'juick-server-jdbc')
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |