Compare commits
2 Commits
b0bb2e66a8
...
197beb828a
| Author | SHA1 | Date | |
|---|---|---|---|
|
197beb828a
|
|||
|
ab57683797
|
43
README.md
43
README.md
@@ -1,20 +1,24 @@
|
||||
# Kotlin Hash
|
||||
# hash-kt
|
||||
|
||||
This library provides various [Cryptographic Hash Function](https://en.wikipedia.org/wiki/Cryptographic_hash_function)
|
||||
implementations in Kotlin Multiplatform.
|
||||
`hash-kt` is a Kotlin Multiplatform library that provides common cryptographic hash functions.
|
||||
|
||||
## 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)
|
||||
* [SHA1](https://en.wikipedia.org/wiki/SHA-1)
|
||||
* [SHA224](https://en.wikipedia.org/wiki/SHA-2)
|
||||
* [SHA256](https://en.wikipedia.org/wiki/SHA-2)
|
||||
* [SHA384](https://en.wikipedia.org/wiki/SHA-2)
|
||||
* [SHA512](https://en.wikipedia.org/wiki/SHA-2)
|
||||
* Multiplatform support
|
||||
* JVM
|
||||
* JavaScript
|
||||
* Native (Linux)
|
||||
## Targets
|
||||
|
||||
| Target | Status |
|
||||
|------------------|---------------|
|
||||
| JVM | Supported |
|
||||
| JavaScript | Supported |
|
||||
| Native (Linux) | Supported |
|
||||
| Native (Windows) | Not Supported |
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -26,18 +30,19 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.infendro:hash:1.2.2")
|
||||
implementation("com.infendro:hash:1.3.2")
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```kotlin
|
||||
import com.infendro.hash.SHA256
|
||||
import com.infendro.hash.sha2.`SHA-256`
|
||||
|
||||
fun main() {
|
||||
// hash some value using SHA256
|
||||
val value = "...".encodeToByteArray()
|
||||
val hash = SHA256.hash(value)
|
||||
// hash some value using SHA-256
|
||||
val value = "Hello World!"
|
||||
.encodeToByteArray().asUByteArray()
|
||||
val hash = `SHA-256`.hash(value)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[versions]
|
||||
infendro = "1.0.0"
|
||||
kotlin = "2.2.21"
|
||||
bytearray = "1.2.3"
|
||||
bytearray = "1.2.4"
|
||||
|
||||
[plugins]
|
||||
infendro = { id = "com.infendro.plugin", version.ref = "infendro" }
|
||||
|
||||
Reference in New Issue
Block a user