37 lines
799 B
Markdown
37 lines
799 B
Markdown
# hash-kt
|
|
|
|
`hash-kt` is a Kotlin Multiplatform library that provides common [Cryptographic Hash Functions](https://en.wikipedia.org/wiki/Cryptographic_hash_function).
|
|
|
|
Supported algorithms:
|
|
- MD5
|
|
- SHA-1
|
|
- SHA-2 (SHA-224, SHA-256, SHA-384, SHA-512)
|
|
- SHA-3 (SHA3-224, SHA3-256, SHA3-384, SHA3-512)
|
|
- SHAKE (SHAKE128, SHAKE256)
|
|
- Blake (Blake-224, Blake-256, Blake-384, Blake-512)
|
|
- Blake2 (Blake2s, Blake2b)
|
|
|
|
## Installation
|
|
|
|
Add the following to your `build.gradle.kts`.
|
|
|
|
```kotlin
|
|
repositories {
|
|
maven("https://git.infendro.com/api/packages/Infendro/maven")
|
|
}
|
|
|
|
dependencies {
|
|
implementation("com.infendro:hash:1.5.1")
|
|
}
|
|
```
|
|
|
|
## Usage
|
|
|
|
```kotlin
|
|
fun main() {
|
|
// hash some value using SHA-256
|
|
val value = "Hello World!".encodeToByteArray()
|
|
val hash = `SHA-256`.hash(value)
|
|
}
|
|
```
|