scalafmt
parent
477e6b5ff8
commit
cb9dadc092
|
@ -6,7 +6,14 @@ import play.api.i18n.Lang
|
||||||
|
|
||||||
import lila.common.Nonce
|
import lila.common.Nonce
|
||||||
|
|
||||||
case class EmbedConfig(bg: String, board: String, pieceSet: lila.pref.PieceSet, lang: Lang, req: RequestHeader, nonce: Nonce)
|
case class EmbedConfig(
|
||||||
|
bg: String,
|
||||||
|
board: String,
|
||||||
|
pieceSet: lila.pref.PieceSet,
|
||||||
|
lang: Lang,
|
||||||
|
req: RequestHeader,
|
||||||
|
nonce: Nonce
|
||||||
|
)
|
||||||
|
|
||||||
object EmbedConfig {
|
object EmbedConfig {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ object AccessToken {
|
||||||
|
|
||||||
case class Id(value: String) extends AnyVal
|
case class Id(value: String) extends AnyVal
|
||||||
object Id {
|
object Id {
|
||||||
def random() = Id(s"lio_${SecureRandom.nextString(32)}")
|
def random() = Id(s"lio_${SecureRandom.nextString(32)}")
|
||||||
def randomPersonal() = Id(SecureRandom.nextString(16)) // TODO: remove
|
def randomPersonal() = Id(SecureRandom.nextString(16)) // TODO: remove
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,11 @@ case class Team(
|
||||||
def publicForum: Boolean = !hideForum.has(true)
|
def publicForum: Boolean = !hideForum.has(true)
|
||||||
|
|
||||||
def passwordMatches(pw: String) =
|
def passwordMatches(pw: String) =
|
||||||
password.forall(teamPw => teamPw.size == pw.size && teamPw.zip(pw).foldLeft(0) {
|
password.forall(teamPw =>
|
||||||
case (acc, (a, b)) => acc | (a ^ b) // constant time
|
teamPw.size == pw.size && teamPw.zip(pw).foldLeft(0) { case (acc, (a, b)) =>
|
||||||
} == 0)
|
acc | (a ^ b) // constant time
|
||||||
|
} == 0
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
object Team {
|
object Team {
|
||||||
|
|
Loading…
Reference in New Issue