diff options
| author | ruki <[email protected]> | 2025-09-30 22:43:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-09-30 22:43:05 +0800 |
| commit | 703dec087d98946bc2ba5384d2274e588f8ee96d (patch) | |
| tree | 27cc9c304c05c2916135b3afc2d8e4e51f828834 /xmake/core/package/package.lua | |
| parent | 9dd7fe46d8678216b62016b721fe084d5bad9246 (diff) | |
improve strhash
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 4b0ddd036..4c68f277c 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1687,6 +1687,12 @@ function _instance:_compute_buildhash() self:buildhash() end +-- hash.strhash128 has been switched to xxhash. +-- For compatibility, the old hash algorithm is still used here. +function _instance:_strhash128(str) + return hash.uuid4(str):replace("-", "", {plain = true}):lower() +end + -- get the build hash function _instance:buildhash() local buildhash = self._BUILDHASH @@ -1748,7 +1754,7 @@ function _instance:buildhash() table.sort(toolchains) str = str .. "_" .. table.concat(toolchains, "_") end - return hash.strhash128(str) + return self:_strhash128(str) end local function _get_installdir(...) local name = self:name():lower():gsub("::", "_") |
