1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 23:06:43 +02:00
This commit is contained in:
Justin Lin
2022-03-05 10:47:24 +08:00
parent a8e903ccb7
commit ec276b274f

View File

@@ -1,11 +1,8 @@
use <../util/sum.scad>;
function _str_hash(value) =
let(
s = str(value),
leng = len(s)
)
let(s = str(value))
sum([
for(i = [0:leng - 1])
ord(s[i]) * 31 ^ (leng - 1 - i)
for(i = len(s) - 1; i > -1; i = i - 1)
ord(s[i]) * 31 ^ i
]);