com.lightningkite.lightningserver.auth.SecureHashKtTest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of server-core Show documentation
Show all versions of server-core Show documentation
A set of tools to fill in/replace what Ktor is lacking in.
The newest version!
package com.lightningkite.lightningserver.auth
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import kotlin.system.measureTimeMillis
class SecureHashKtTest {
@Test
fun realTest() {
val hash = "asdf".secureHash()
println("Hash is $hash")
measureTimeMillis {
assertTrue("asdf".checkHash(hash))
}.also { println(it) }
measureTimeMillis {
assertFalse("asdff".checkHash(hash))
}.also { println(it) }
}
}