In this sample from Ktor website https://ktor.io/samples/feature/auth.html they use an account "test" with password "test" as example.
@UseExperimental(KtorExperimentalAPI::class)
val hashedUserTable = UserHashedTableAuth(
getDigestFunction("SHA-256") { "ktor${it.length}" },
table = mapOf(
"test" to Base64.getDecoder().decode("GSjkHCHGAxTTbnkEDBbVYd+PUFRlcWiumc4+MWE9Rvw=") // sha256 for "test"
)
)
I need to create another entry, but I can't figure out how they got that hash. I tried to sha256 the word "test", salted or not, tried to base64 the result... Nothing matches that hash so I'm unable to create another user.
Anyone could enlighten me here on how to create a compatible hash with that code?