io.appwrite.models.AlgoScrypt.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
/**
* AlgoScrypt
*/
data class AlgoScrypt(
/**
* Algo type.
*/
@SerializedName("type")
val type: String,
/**
* CPU complexity of computed hash.
*/
@SerializedName("costCpu")
val costCpu: Long,
/**
* Memory complexity of computed hash.
*/
@SerializedName("costMemory")
val costMemory: Long,
/**
* Parallelization of computed hash.
*/
@SerializedName("costParallel")
val costParallel: Long,
/**
* Length used to compute hash.
*/
@SerializedName("length")
val length: Long,
) {
fun toMap(): Map = mapOf(
"type" to type as Any,
"costCpu" to costCpu as Any,
"costMemory" to costMemory as Any,
"costParallel" to costParallel as Any,
"length" to length as Any,
)
companion object {
@Suppress("UNCHECKED_CAST")
fun from(
map: Map,
) = AlgoScrypt(
type = map["type"] as String,
costCpu = (map["costCpu"] as Number).toLong(),
costMemory = (map["costMemory"] as Number).toLong(),
costParallel = (map["costParallel"] as Number).toLong(),
length = (map["length"] as Number).toLong(),
)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy