Update Home
42
Home.md
42
Home.md
@@ -1,22 +1,48 @@
|
|||||||
# Hash
|
# hash-kt
|
||||||
|
|
||||||
**Hash** is a Kotlin Multiplatform library providing implementations of various cryptographic hash functions.
|
`hash-kt` is a Kotlin Multiplatform library that provides common cryptographic hash functions.
|
||||||
|
|
||||||
|
Supported hash functions:
|
||||||
|
- 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)
|
||||||
|
|
||||||
## Features
|
## Targets
|
||||||
|
|
||||||
- MD5, SHA-1, SHA-2
|
|
||||||
- JVM, JavaScript, Native
|
|
||||||
|
|
||||||
|
| Target | Status |
|
||||||
|
|------------------|---------------|
|
||||||
|
| JVM | Supported |
|
||||||
|
| JavaScript | Supported |
|
||||||
|
| Native (Linux) | Supported |
|
||||||
|
| Native (Windows) | Not Supported |
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
Add the following to your `build.gradle.kts`.
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
repositories {
|
repositories {
|
||||||
maven("https://git.infendro.com/api/packages/Infendro/maven")
|
maven("https://git.infendro.com/api/packages/Infendro/maven")
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("com.infendro:hash:1.2.2")
|
implementation("com.infendro:hash:1.3.2")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
import com.infendro.hash.sha2.`SHA-256`
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
// hash some value using SHA-256
|
||||||
|
val value = "Hello World!"
|
||||||
|
.encodeToByteArray().asUByteArray()
|
||||||
|
val hash = `SHA-256`.hash(value)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user