Compare commits

..

2 Commits

Author SHA1 Message Date
197beb828a upgrade dependency 2025-12-13 21:00:33 +01:00
ab57683797 update README 2025-12-13 21:00:22 +01:00
2 changed files with 25 additions and 20 deletions

View File

@@ -1,20 +1,24 @@
# Kotlin Hash # hash-kt
This library provides various [Cryptographic Hash Function](https://en.wikipedia.org/wiki/Cryptographic_hash_function) `hash-kt` is a Kotlin Multiplatform library that provides common cryptographic hash functions.
implementations in Kotlin Multiplatform.
## Features 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)
* [MD5](https://en.wikipedia.org/wiki/MD5) ## Targets
* [SHA1](https://en.wikipedia.org/wiki/SHA-1)
* [SHA224](https://en.wikipedia.org/wiki/SHA-2) | Target | Status |
* [SHA256](https://en.wikipedia.org/wiki/SHA-2) |------------------|---------------|
* [SHA384](https://en.wikipedia.org/wiki/SHA-2) | JVM | Supported |
* [SHA512](https://en.wikipedia.org/wiki/SHA-2) | JavaScript | Supported |
* Multiplatform support | Native (Linux) | Supported |
* JVM | Native (Windows) | Not Supported |
* JavaScript
* Native (Linux)
## Installation ## Installation
@@ -26,18 +30,19 @@ repositories {
} }
dependencies { dependencies {
implementation("com.infendro:hash:1.2.2") implementation("com.infendro:hash:1.3.2")
} }
``` ```
## Usage ## Usage
```kotlin ```kotlin
import com.infendro.hash.SHA256 import com.infendro.hash.sha2.`SHA-256`
fun main() { fun main() {
// hash some value using SHA256 // hash some value using SHA-256
val value = "...".encodeToByteArray() val value = "Hello World!"
val hash = SHA256.hash(value) .encodeToByteArray().asUByteArray()
val hash = `SHA-256`.hash(value)
} }
``` ```

View File

@@ -1,7 +1,7 @@
[versions] [versions]
infendro = "1.0.0" infendro = "1.0.0"
kotlin = "2.2.21" kotlin = "2.2.21"
bytearray = "1.2.3" bytearray = "1.2.4"
[plugins] [plugins]
infendro = { id = "com.infendro.plugin", version.ref = "infendro" } infendro = { id = "com.infendro.plugin", version.ref = "infendro" }