Skip to content

Commit

Permalink
chore: upgrade uuid (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
skjindal93 authored Aug 23, 2022
1 parent 38a6171 commit 489c5d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion attribute-projection-functions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {

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

testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static java.util.Objects.nonNull;

import com.github.f4b6a3.uuid.UuidCreator;
import com.github.f4b6a3.uuid.creator.rfc4122.NameBasedSha1UuidCreator;
import java.util.UUID;
import javax.annotation.Nullable;

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

@Nullable
public static String hash(@Nullable String value) {
return nonNull(value) ? HASHER.create(value).toString() : null;
return nonNull(value) ? UuidCreator.getNameBasedSha1(NAMESPACE_UUID, value).toString() : null;
}
}

0 comments on commit 489c5d3

Please sign in to comment.