diff options
| author | ruki <[email protected]> | 2024-10-11 00:55:26 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-10-11 00:55:26 +0800 |
| commit | d023f3501a95bcd2c7475b578bed7585d8ed60d3 (patch) | |
| tree | 8471660ffd078779e04ba09c2a67ae178e1eb65e /xmake/core/base | |
| parent | c189bb54bc616f219d7881c032a207fdaa385a17 (diff) | |
rename to strhash
Diffstat (limited to 'xmake/core/base')
| -rw-r--r-- | xmake/core/base/hash.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/base/hash.lua b/xmake/core/base/hash.lua index be831c205..44502ad19 100644 --- a/xmake/core/base/hash.lua +++ b/xmake/core/base/hash.lua @@ -101,13 +101,13 @@ function hash.uuid(str) return hash.uuid4(str) end --- generate hash32, e.g. "91e8ecf1" -function hash.hash32(str) +-- generate hash32 from string, e.g. "91e8ecf1" +function hash.strhash32(str) return hash.uuid4(str):split("-", {plain = true})[1]:lower() end --- generate hash128, e.g. "91e8ecf1417f4edfa574e22d7d8d204a" -function hash.hash128(str) +-- generate hash128 from string, e.g. "91e8ecf1417f4edfa574e22d7d8d204a" +function hash.strhash128(str) return hash.uuid4(str):replace("-", "", {plain = true}):lower() end |
