Skip to content

Commit

Permalink
release 0.2.1
Browse files Browse the repository at this point in the history
backport to v0.2: fix bug for when the first suffix character exceeds 1 byte
  • Loading branch information
fxlae committed May 18, 2024
1 parent a0edd2c commit 0919ba3
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 23 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/build-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ jobs:
build-gradle-project:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/gradle-build-action@v2.5.1
with:
gradle-version: wrapper
arguments: build
- uses: gradle/actions/setup-gradle@v3
- run: ./gradlew build
11 changes: 5 additions & 6 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/gradle-build-action@v2.5.1
with:
gradle-version: wrapper
arguments: build publishAllPublicationsToOSSRHRepository
- uses: gradle/actions/setup-gradle@v3
- run: ./gradlew build
- run: ./gradlew publishAllPublicationsToOSSRHRepository
env:
ORG_GRADLE_PROJECT_OSSRHUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_OSSRHPassword: ${{ secrets.OSSRH_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ To install via Maven:
<dependency>
<groupId>de.fxlae</groupId>
<artifactId>typeid-java</artifactId> <!-- or 'typeid-java-jdk8' -->
<version>0.2.0</version>
<version>0.2.1</version>
</dependency>
```

For installation via Gradle:

```kotlin
implementation("de.fxlae:typeid-java:0.2.0") // or ...typeid-java-jdk8:0.2.0
implementation("de.fxlae:typeid-java:0.2.1") // or ...typeid-java-jdk8:0.2.1
```

## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "de.fxlae"
version = "0.2.0"
version = "0.2.1"

java {
withJavadocJar()
Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versions]
java-uuid-generator = "4.2.0"
jackson = "2.15.2"
junit = "5.9.1"
assertj = "3.24.2"
java-uuid-generator = "5.0.0"
jackson = "2.17.0"
junit = "5.10.2"
assertj = "3.25.3"
shadow = "8.1.1"
jmh = "0.7.1"
jmh = "0.7.2"

[plugins]
jmh = { id = "me.champeau.jmh", version.ref = "jmh" }
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ artifacts {
}

dependencies {
implementation("com.fasterxml.uuid:java-uuid-generator:4.2.0")
implementation("com.fasterxml.uuid:java-uuid-generator:5.0.0")
}
5 changes: 3 additions & 2 deletions lib/shared/src/main/java/de/fxlae/typeid/lib/TypeIdLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public final class TypeIdLib {
NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP,
NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, 0x0A, 0x0B, 0x0C, // a, b, c
0x0D, 0x0E, 0x0F, 0x10, 0x11, NOOP, 0x12, 0x13, NOOP, 0x14, // d, e, f, g, h, j, k, m
0x15, NOOP, 0x16, 0x17, 0x18, 0x19, 0x1A, NOOP, 0x1B, 0x1C, // n, p, q, r, s, value, v, w
0x15, NOOP, 0x16, 0x17, 0x18, 0x19, 0x1A, NOOP, 0x1B, 0x1C, // n, p, q, r, s, t, v, w
0x1D, 0x1E, 0x1F, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, // x, y, z
NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP,
NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP,
Expand Down Expand Up @@ -191,7 +191,8 @@ private static String validateSuffixOnInput(final String input, final int separa
return "Suffix with illegal length, must be " + SUFFIX_LENGTH;
}

if (((SUFFIX_LOOKUP[input.charAt(start)] >>> 3) & 0x3) > 0) {
final char firstChar = input.charAt(start);
if (firstChar < '0' || firstChar > '7') {
return "Illegal leftmost suffix character, must be one of [01234567]";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ void parseWithValidInputsShouldReturnTypeId(String input) {
"_01h455vb4pex5vsknk084sn02q", // suffix only, but with preceding underscore
"sömeprefix_01h455vb4pex5vsknk084sn02q", // prefix with 'ö'
"someprefix_01h455öb4pex5vsknk084sn02q", // suffix with 'ö'
"someprefix_Ă01h455b4pex5vsknk084sn02q", // suffix with 'Ă' (> ascii 255) as first char
"sOmeprefix_01h455vb4pex5vsknk084sn02q", // prefix with 'O'
"someprefix_01h455Vb4pex5vsknk084sn02q", // suffix with 'V'
"someprefix_01h455lb4pex5vsknk084sn02q", // suffix with 'l'
Expand Down

0 comments on commit 0919ba3

Please sign in to comment.