mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-08 15:56:42 +02:00
refactor
This commit is contained in:
@@ -1,11 +1,8 @@
|
|||||||
use <../util/sum.scad>;
|
use <../util/sum.scad>;
|
||||||
|
|
||||||
function _str_hash(value) =
|
function _str_hash(value) =
|
||||||
let(
|
let(s = str(value))
|
||||||
s = str(value),
|
|
||||||
leng = len(s)
|
|
||||||
)
|
|
||||||
sum([
|
sum([
|
||||||
for(i = [0:leng - 1])
|
for(i = len(s) - 1; i > -1; i = i - 1)
|
||||||
ord(s[i]) * 31 ^ (leng - 1 - i)
|
ord(s[i]) * 31 ^ i
|
||||||
]);
|
]);
|
Reference in New Issue
Block a user