Skip to content

Use HexFormat instead of custom Hex codec - #19641

Open
therepanic wants to merge 1 commit into
spring-projects:mainfrom
therepanic:hex
Open

Use HexFormat instead of custom Hex codec#19641
therepanic wants to merge 1 commit into
spring-projects:mainfrom
therepanic:hex

Conversation

@therepanic

Copy link
Copy Markdown
Contributor

Replace internal org.springframework.security.crypto.codec.Hex utility class with standard Java 17 java.util.HexFormat. We already did something similar in this module earlier: 2f53a2e

Replace internal org.springframework.security.crypto.codec.Hex utility class with standard Java 17 java.util.HexFormat. We already did something similar in this module earlier: 2f53a2e

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
Comment on lines -85 to +84
return new String(Hex.encode(sha(data)));
return HexFormat.of().formatHex(sha(data));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, the string was created without regard for the string pool, but now the string pool is being used. Perhaps it should be wrapped in new String()?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 1, 2026
@therepanic

Copy link
Copy Markdown
Contributor Author

It also renders #19023 unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants