Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516
  1. package com.dmdirc.ktirc.util
  2. import com.dmdirc.ktirc.IrcClient
  3. import com.dmdirc.ktirc.sasl.toBase64
  4. import java.time.ZoneOffset
  5. internal var generateLabel = { ircClient: IrcClient ->
  6. val time = currentTimeProvider().toEpochSecond(ZoneOffset.UTC)
  7. val counter = ircClient.serverState.labelCounter.incrementAndGet()
  8. ByteArray(6) {
  9. when {
  10. it < 3 -> ((time shr it) and 0xff).toByte()
  11. else -> ((counter shr (it - 3)) and 0xff).toByte()
  12. }
  13. }.toBase64()
  14. }