Skip to content

Commit

Permalink
fix: Fix name digest for noprefix (#2448)
Browse files Browse the repository at this point in the history
  • Loading branch information
sydney-munro authored Mar 15, 2024
1 parent 110b80c commit 12c9db8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,10 @@ public NoPrefix(SecureRandom rand) {
}

@Override
protected String fmtFields(String randomKey, String nameDigest, String partRange) {
protected String fmtFields(String randomKey, String ultimateObjectName, String partRange) {
HashCode hashCode =
OBJECT_NAME_HASH_FUNCTION.hashString(ultimateObjectName, StandardCharsets.UTF_8);
String nameDigest = B64.encodeToString(hashCode.asBytes());
return randomKey
+ FIELD_SEPARATOR
// todo: do we want to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void partNameStrategy_objectNamePrefix() throws Exception {
// name digest
() -> assertField(fmt, 1).hasLength(22),
() -> assertField(fmt, 2).isEqualTo("0001-0096.part"),
() -> assertThat(fmt).startsWith("a/b/obj/"));
() -> assertThat(fmt).startsWith("a/b/obj"));
}

private static StringSubject assertField(String fmt, int idx) {
Expand Down

0 comments on commit 12c9db8

Please sign in to comment.