add README
This commit is contained in:
45
README.md
Normal file
45
README.md
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# Kotlin Encoding
|
||||||
|
|
||||||
|
This library provides various character encodings in Kotlin Multiplatform.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
* Encode and decode ByteArrays using various character encodings.
|
||||||
|
* Binary
|
||||||
|
* Hex
|
||||||
|
* Base32
|
||||||
|
* Base64
|
||||||
|
* Multiplatform support
|
||||||
|
* JVM
|
||||||
|
* JavaScript
|
||||||
|
* 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:encoding:1.1.0")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
import com.infendro.encoding.Hex
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
// the string to encode
|
||||||
|
val test = "Hello World!".encodeToByteArray()
|
||||||
|
|
||||||
|
// encode the string with the desired encoding
|
||||||
|
val encoded = Hex.encode(test).decodeToString()
|
||||||
|
|
||||||
|
println(encoded) // 48656c6c6f20576f726c6421
|
||||||
|
}
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user