io.appwrite.models.AlgoArgon2.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-for-kotlin Show documentation
Show all versions of sdk-for-kotlin Show documentation
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Kotlin SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
package io.appwrite.models
import com.google.gson.annotations.SerializedName
import io.appwrite.extensions.jsonCast
/**
* AlgoArgon2
*/
data class AlgoArgon2(
/**
* Algo type.
*/
@SerializedName("type")
val type: String,
/**
* Memory used to compute hash.
*/
@SerializedName("memoryCost")
val memoryCost: Long,
/**
* Amount of time consumed to compute hash
*/
@SerializedName("timeCost")
val timeCost: Long,
/**
* Number of threads used to compute hash.
*/
@SerializedName("threads")
val threads: Long,
) {
fun toMap(): Map = mapOf(
"type" to type as Any,
"memoryCost" to memoryCost as Any,
"timeCost" to timeCost as Any,
"threads" to threads as Any,
)
companion object {
@Suppress("UNCHECKED_CAST")
fun from(
map: Map,
) = AlgoArgon2(
type = map["type"] as String,
memoryCost = (map["memoryCost"] as Number).toLong(),
timeCost = (map["timeCost"] as Number).toLong(),
threads = (map["threads"] as Number).toLong(),
)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy