Skip to content

Commit

Permalink
Prepare 2.3.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm committed Dec 18, 2024
1 parent de9e40b commit f282550
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 21 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# CHANGELOG

## Version 2.3.1 (2024-12-18)
- Fixes performance issues introduced in `2.3.0` [[#162]][162]:
- Deprecates the following which were introduced in `2.3.0`:
- `CTCase` class
- `DecoderAction` functional interface
- `DecoderAction.Parser` class
- `Base16ConfigBuilder.isconstantTime` variable
- `Base32CrockfordConfigBuilder.isconstantTime` variable
- `Base32HexConfigBuilder.isconstantTime` variable
- `Base64ConfigBuilder.isconstantTime` variable
- All encoders (Base16/32/64) are now written in a constant-time
manner. Performance impact when compared to `2.2.2` was "negligible" (in
the neighborhood of ~4% depending on platform), given the implications.
- Adds benchmarking to repository [[#160]][160]

## Version 2.3.0 (2024-12-15)
- Fixes `Encoder.Companion` extension function `ByteArray.encodeToString` not zeroing
out its local `StringBuilder` before returning encoded data. [[#155]][155]
Expand Down Expand Up @@ -213,4 +228,6 @@
[156]: https://github.com/05nelsonm/encoding/pull/156
[157]: https://github.com/05nelsonm/encoding/pull/157
[158]: https://github.com/05nelsonm/encoding/pull/158
[160]: https://github.com/05nelsonm/encoding/pull/160
[162]: https://github.com/05nelsonm/encoding/pull/162
[MIGRATION]: https://github.com/05nelsonm/encoding/blob/master/MIGRATION.md
40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding
[![badge-license]][url-license]
[![badge-latest-release]][url-latest-release]
[![badge-latest]][url-latest]

[![badge-kotlin]][url-kotlin]

Expand All @@ -22,17 +22,19 @@

Configurable, streamable, efficient and extensible Encoding/Decoding for Kotlin Multiplatform.

API docs available at [https://encoding.matthewnelson.io][url-docs]

**Base16 (a.k.a. "hex")**
- [RFC 4648 section 8](https://www.ietf.org/rfc/rfc4648.html#section-8)
- [RFC 4648 section 8][url-rfc-s8]

**Base32**
- [Crockford](https://www.crockford.com/base32.html)
- Default [RFC 4648 section 6](https://www.ietf.org/rfc/rfc4648.html#section-6)
- Hex [RFC 4648 section 7](https://www.ietf.org/rfc/rfc4648.html#section-7)
- [Crockford][url-crockford]
- Default [RFC 4648 section 6][url-rfc-s6]
- Hex [RFC 4648 section 7][url-rfc-s7]

**Base64**
- Default [RFC 4648 section 4](https://www.ietf.org/rfc/rfc4648.html#section-4)
- UrlSafe [RFC 4648 section 5](https://www.ietf.org/rfc/rfc4648.html#section-5)
- Default [RFC 4648 section 4][url-rfc-s4]
- UrlSafe [RFC 4648 section 5][url-rfc-s5]

### Usage

Expand Down Expand Up @@ -164,10 +166,10 @@ val sb = StringBuilder()
val out = LineBreakOutFeed(interval = 64) { char -> sb.append(char) }

Base64.Default.newEncoderFeed(out).use { feed ->
"Hello World 1!".forEach { c -> feed.consume(c.code.toByte()) }
"Hello World 1!".encodeToByteArray().forEach { b -> feed.consume(b) }
feed.flush()
out.output('.')
"Hello World 2!".forEach { c -> feed.consume(c.code.toByte()) }
"Hello World 2!".encodeToByteArray().forEach { b -> feed.consume(b) }
}

println(sb.toString())
Expand Down Expand Up @@ -256,8 +258,7 @@ file.inputStream().reader().use { iStreamReader ->
println(sb.toString())
```

**Alternatively, create your own `EncoderDecoder`(s) using the abstractions provided by `encoding-core`!**

**Alternatively, create your own `EncoderDecoder`(s) using the abstractions provided by `encoding-core`**

### Sample

Expand All @@ -270,7 +271,7 @@ See [sample project](sample/README.md)
```kotlin
// build.gradle.kts
dependencies {
val encoding = "2.3.0"
val encoding = "2.3.1"
implementation("io.matthewnelson.encoding:base16:$encoding")
implementation("io.matthewnelson.encoding:base32:$encoding")
implementation("io.matthewnelson.encoding:base64:$encoding")
Expand All @@ -287,7 +288,7 @@ Alternatively, you can use the BOM.
// build.gradle.kts
dependencies {
// define the BOM and its version
implementation(platform("io.matthewnelson.encoding:bom:2.3.0"))
implementation(platform("io.matthewnelson.encoding:bom:2.3.1"))

// define artifacts without version
implementation("io.matthewnelson.encoding:base16")
Expand All @@ -300,7 +301,7 @@ dependencies {
```

<!-- TAG_VERSION -->
[badge-latest-release]: https://img.shields.io/badge/latest--release-2.3.0-blue.svg?style=flat
[badge-latest]: https://img.shields.io/badge/latest--release-2.3.1-blue.svg?style=flat
[badge-license]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat

<!-- TAG_DEPENDENCIES -->
Expand All @@ -323,6 +324,13 @@ dependencies {
[badge-support-js-ir]: https://img.shields.io/badge/support-[js--IR]-AAC4E0.svg?style=flat
[badge-support-linux-arm]: http://img.shields.io/badge/support-[LinuxArm]-2D3F6C.svg?style=flat

[url-latest-release]: https://github.com/05nelsonm/encoding/releases/latest
[url-license]: https://www.apache.org/licenses/LICENSE-2.0.txt
[url-crockford]: https://www.crockford.com/base32.html
[url-docs]: https://encoding.matthewnelson.io]
[url-kotlin]: https://kotlinlang.org
[url-latest]: https://github.com/05nelsonm/encoding/releases/latest
[url-license]: https://www.apache.org/licenses/LICENSE-2.0.txt
[url-rfc-s4]: https://www.ietf.org/rfc/rfc4648.html#section-4
[url-rfc-s5]: https://www.ietf.org/rfc/rfc4648.html#section-5
[url-rfc-s6]: https://www.ietf.org/rfc/rfc4648.html#section-6
[url-rfc-s7]: https://www.ietf.org/rfc/rfc4648.html#section-7
[url-rfc-s8]: https://www.ietf.org/rfc/rfc4648.html#section-8
13 changes: 9 additions & 4 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,32 @@

Benchmarks for tracking performance of `encoding` implementation.

**NOTE:** Benchmarking is run on every Pull Request. Results can be viewed for each
workflow run on the [GitHub Actions][url-actions] tab of the repository.

- Run All platforms:
```shell
./gradlew benchmark
```

- Run Jvm:
```shell
./gradlew benchmark -PKMP_TARGETS="JVM"
./gradlew jvmBenchmark
```

- Run Js:
```shell
./gradlew benchmark -PKMP_TARGETS="JS"
./gradlew jsBenchmark
```

- Run WasmJs:
```shell
./gradlew benchmark -PKMP_TARGETS="WASM_JS"
./gradlew wasmJsBenchmark
```

- Run Native:
```shell
./gradlew benchmark -PKMP_TARGETS="LINUX_ARM64,LINUX_X64,MACOS_ARM64,MACOS_X64,MINGW_X64"
./gradlew nativeHostBenchmark
```

[url-actions]: https://github.com/05nelsonm/encoding/actions/
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ POM_DEVELOPER_ID=05nelsonm
POM_DEVELOPER_NAME=Matthew Nelson
POM_DEVELOPER_URL=https://github.com/05nelsonm/

VERSION_NAME=2.3.1-SNAPSHOT
VERSION_NAME=2.3.1
# 0.1.0-alpha01 = 00 01 00 11
# 0.1.0-beta01 = 00 01 00 21
# 0.1.0-rc01 = 00 01 00 31
Expand Down

0 comments on commit f282550

Please sign in to comment.