Skip to content

Commit

Permalink
[MWRAPPER-123] hash string char-by-char for AIX's ksh implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarwell committed Feb 3, 2024
1 parent 021a333 commit 6b8cd96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion maven-wrapper-distribution/src/resources/only-mvnw
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ set_java_home() {
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
h=$(( ( h * 31 + $(LC_CTYPE=C printf %d "'$str") ) % 4294967296 ))
char="${str%${str#?}}"
h=$(( ( h * 31 + $(LC_CTYPE=C printf %d "'$char") ) % 4294967296 ))
str="${str#?}"
done
printf %x\\n $h
Expand Down

0 comments on commit 6b8cd96

Please sign in to comment.