Skip to content

Commit 489c5d3

Browse files
authored
chore: upgrade uuid (#139)
1 parent 38a6171 commit 489c5d3

File tree

2 files changed

+4
-6
lines changed
  • attribute-projection-functions

2 files changed

+4
-6
lines changed

attribute-projection-functions/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77

88
dependencies {
99
api("com.google.code.findbugs:jsr305:3.0.2")
10-
implementation("com.github.f4b6a3:uuid-creator:3.5.0")
10+
implementation("com.github.f4b6a3:uuid-creator:5.1.0")
1111

1212
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
1313
}

attribute-projection-functions/src/main/java/org/hypertrace/core/attribute/service/projection/functions/Hash.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import static java.util.Objects.nonNull;
44

55
import com.github.f4b6a3.uuid.UuidCreator;
6-
import com.github.f4b6a3.uuid.creator.rfc4122.NameBasedSha1UuidCreator;
76
import java.util.UUID;
87
import javax.annotation.Nullable;
98

@@ -14,12 +13,11 @@ public class Hash {
1413
* would change any existing projections containing a hash and orphan any data persisted against
1514
* that such as stored entities.
1615
*/
17-
private static final NameBasedSha1UuidCreator HASHER =
18-
UuidCreator.getNameBasedSha1Creator()
19-
.withNamespace(UUID.fromString("5088c92d-5e9c-43f4-a35b-2589474d5642"));
16+
private static final UUID NAMESPACE_UUID =
17+
UUID.fromString("5088c92d-5e9c-43f4-a35b-2589474d5642");
2018

2119
@Nullable
2220
public static String hash(@Nullable String value) {
23-
return nonNull(value) ? HASHER.create(value).toString() : null;
21+
return nonNull(value) ? UuidCreator.getNameBasedSha1(NAMESPACE_UUID, value).toString() : null;
2422
}
2523
}

0 commit comments

Comments
 (0)