model.PasswordHashBSONCodec.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of baku Show documentation
Show all versions of baku Show documentation
helps you focus your REST API back-end on the business logic
package com.github.fluidsonic.baku
import org.bson.BsonReader
import org.bson.BsonWriter
internal object PasswordHashBSONCodec : AbstractBSONCodec() {
override fun BsonReader.decode(context: BSONCodingContext) =
PasswordHash(readString())
override fun BsonWriter.encode(value: PasswordHash, context: BSONCodingContext) {
writeString(value.raw)
}
}