Skip to content

Commit 3b53aae

Browse files
committed
important fix in sorintf %f/%e rounding. added base64Url support
1 parent 29bb2cf commit 3b53aae

7 files changed

Lines changed: 448 additions & 347 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/build/classes/kotlin/jvm/main/
66
/build/classes/kotlin/jvm/test/
77
/build/classes/kotlin/native/main/klib/
8+
/testlog*

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# MP Sergeych's tools
1+
# MP (actually KMM) Sergeych's tools
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44

5-
> Important: We recommend to upgrade to `1.2.2`. Version `1.2.3-SNAPSHOT` is a work in progress also to add ios targets
5+
> Important: We recommend to upgrade to `1.3.2-SNAPSHOT+`. It has important fixes (in float format).
66
7-
There was a bug in `1.0.*`, fixed since `1.1.0`, please upgrade your dependencies. Also, 1.2.* fixes incorrect
8-
package naming.
9-
10-
(well it was _string tools_ once, then I found few vital ByteArray (therefore binary) tools missing in MP form, so now
11-
its sergeych;'s tools ;) )
7+
Kotlin Multiplatform (also KMM) important missing tools, like sprintf with wide variety of formats, portable base64
128

139
# Why reinventing the wheel?
1410

15-
When I has started to write our applications and libraries in MP mode, as our code work the same on 3 of the plaforms we
11+
When I had started to write our applications and libraries in MP mode, as our code work the same on 3 of the plaforms we
1612
develop for, I have found that many tools our team is used to do not exist on all platforms, or exist with different
1713
interfaces. So, I've started to write protable interfaces to it that works everywhere and _with the same interface_ on
1814
all three platforms.
@@ -24,10 +20,10 @@ Please help me if you like the idea ;)
2420
All 3 platforms:
2521

2622
- `Stirng.sprintf` - something like C `sprinf` or JVM String.format but extended and multiplatform
27-
- base64: `String.encodeToBase64()`, `String.encodeToBase64Compact()`, `ByteArray.decodeBase64()`
28-
and `ByteArray.decodeBase64Compact()`
23+
- base64: `ByteArray.encodeToBase64()`, `ByteArray.encodeToBase64Compact()`, `String.decodeBase64()` and `ByteArray.decodeBase64Compact()`. Also URL-friendly forms: `ByteArray.encodeToBase64Url` and `String.decodeBase64Url`.
24+
2925
- ByteArray tools: `getInt`, `putInt` and fast `indexOf`
30-
- Tools to cache recalculable expressions: `CachedRefreshingValue`, `CachedExpression`
26+
- Tools to cache recalculable expressions: `CachedRefreshingValue`, `CachedExpression` and `CachedSyncExpression` for JVM (as a good multithreading is there)
3127
- Missing `ReenterantMutex` for coroutines
3228
- Smart, fast and effective _asynchronous logging_, coroutine-based, using flows ti subscribe to logs and coroutines and
3329
closures to not to waste time on preparing strings where logging level filters is out anyway.
@@ -324,6 +320,7 @@ one as in the sample above.
324320

325321
# Versions
326322

323+
- '1.3.0-SNAPSHOT' experimental version with upgraded dependenicies, might be not ompatible with older js projects due to this kotlin prolem
327324
- `1.2.3-SNAPSHOT`
328325
- more tools, also some sync tools for JVM convenience
329326
- added some support for ios targets (in progress).

build.gradle.kts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
@file:Suppress("UNUSED_VARIABLE")
22

33
plugins {
4-
kotlin("multiplatform") version "1.6.10"
5-
kotlin("plugin.serialization") version "1.6.10"
4+
kotlin("multiplatform") version "1.7.10"
5+
kotlin("plugin.serialization") version "1.7.10"
66
`maven-publish`
77
}
88

99
group = "net.sergeych"
10-
version = "1.2.3-SNAPSHOT"
10+
version = "1.3.2-SNAPSHOT"
1111

12-
val serialization_version = "1.3.2"
12+
val serialization_version = "1.3.3"
1313

1414
repositories {
1515
mavenCentral()
@@ -25,7 +25,7 @@ kotlin {
2525
useJUnitPlatform()
2626
}
2727
}
28-
js(BOTH) {
28+
js(IR) {
2929
browser {
3030
commonWebpackConfig {
3131
cssSupport.enabled = true
@@ -52,8 +52,8 @@ kotlin {
5252
val commonMain by getting {
5353
dependencies {
5454
api("org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization_version")
55-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1")
56-
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.2")
55+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3")
56+
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
5757
}
5858
}
5959
val commonTest by getting {
@@ -86,12 +86,15 @@ kotlin {
8686
}
8787
repositories {
8888
maven {
89+
val mavenUser: String by project
90+
val mavenPassword: String by project
8991
url = uri("https://maven.universablockchain.com/")
9092
credentials {
91-
username = System.getenv("maven_user")
92-
password = System.getenv("maven_password")
93+
username = mavenUser
94+
password = mavenPassword
9395
}
9496
}
97+
9598
}
9699
}
97100
}

0 commit comments

Comments
 (0)