Playing around with the API, added optins, will remove annotations in next commit

This commit is contained in:
Ugljesa Jovanovic authored and Ugljesa Jovanovic committed 2020-06-05 20:09:38 +02:00
1 parent 9a1073e1c1
commit d901a45b87
11 files changed
+60 -16

No files matched your search

+2
View File
@@ -269,6 +269,8 @@ kotlin {
all {
languageSettings.enableLanguageFeature("InlineClasses")
languageSettings.useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes")
languageSettings.useExperimentalAnnotation("kotlin.ExperimentalStdlibApi")
}
}
@@ -1,7 +1,17 @@
package com.ionspin.kotlin.crypto.sample
object Sample {
fun blakehash() {
import com.ionspin.kotlin.crypto.Crypto
import com.ionspin.kotlin.crypto.CryptoProvider
import com.ionspin.kotlin.crypto.hash.blake2b.Blake2b
import com.ionspin.kotlin.crypto.util.toHexString
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
object Sample {
suspend fun runSample() {
Crypto.initialize()
val blake2bUpdateable = Crypto.Blake2b.updateable()
blake2bUpdateable.update("test")
println(blake2bUpdateable.digest().toHexString())
}
}
@@ -1,18 +1,21 @@
import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bDelegated
import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bStateless
import com.ionspin.kotlin.crypto.sample.Sample
import kotlinx.coroutines.runBlocking
import kotlin.time.ExperimentalTime
import kotlin.time.measureTime
@ExperimentalTime
@ExperimentalStdlibApi
fun main() {
println("Test")
// Blake
val blake = Blake2bDelegated()
val res = blake.digest()
println("Result of res")
// println(res)
val staticRes = Blake2bStateless.digest("test")
println("Result:")
println(staticRes)
fun main() = runBlocking {
Sample.runSample()
// println("Test")
//// Blake
// val blake = Blake2bDelegated()
// val res = blake.digest()
// println("Result of res")
//// println(res)
// val staticRes = Blake2bStateless.digest("test")
// println("Result:")
// println(staticRes)
}