44 lines
953 B
Markdown
44 lines
953 B
Markdown
# Kotlin Hash
|
|
|
|
This library provides various [Cryptographic Hash Function](https://en.wikipedia.org/wiki/Cryptographic_hash_function)
|
|
implementations in Kotlin Multiplatform.
|
|
|
|
## Features
|
|
|
|
* [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)
|
|
|
|
## 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.2.2")
|
|
}
|
|
```
|
|
|
|
## Usage
|
|
|
|
```kotlin
|
|
import com.infendro.hash.SHA256
|
|
|
|
fun main() {
|
|
// hash some value using SHA256
|
|
val value = "...".encodeToByteArray()
|
|
val hash = SHA256.hash(value)
|
|
}
|
|
```
|