mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35:50 +01:00
Use random UUID as blowfish key
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package gitbucket.core.util
|
package gitbucket.core.util
|
||||||
|
|
||||||
import java.net.{URLDecoder, URLEncoder}
|
import java.net.{URLDecoder, URLEncoder}
|
||||||
import java.util.Base64
|
import java.util.{Base64, UUID}
|
||||||
|
|
||||||
import org.mozilla.universalchardet.UniversalDetector
|
import org.mozilla.universalchardet.UniversalDetector
|
||||||
import SyntaxSugars._
|
import SyntaxSugars._
|
||||||
@@ -13,9 +13,7 @@ import scala.util.control.Exception._
|
|||||||
object StringUtil {
|
object StringUtil {
|
||||||
|
|
||||||
private lazy val BlowfishKey = {
|
private lazy val BlowfishKey = {
|
||||||
// last 4 numbers in current timestamp
|
UUID.randomUUID().toString
|
||||||
val time = System.currentTimeMillis.toString
|
|
||||||
time.substring(time.length - 4)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def sha1(value: String): String =
|
def sha1(value: String): String =
|
||||||
|
|||||||
Reference in New Issue
Block a user