exports.hashString = function(str) {
return str.split("").reduce(function(a,b) {
a = ((a << 5) - a) + b.charCodeAt(0);
return a & a;
},0);
};
On Saturday, September 19, 2020 at 1:50:34 PM UTC-7, Jan wrote:
>
> Hi Tiddlydevs,
> Thomas Elminger in his hashmacro uses a tw.utils-hash function:
>
> var hash = $tw.utils.hashString(str);
>
> What kind of hash-function does TW use there? How would you enter it in
> php to reproduce the identical value for the same str serverside.
>
> Thanks for your help!
> Best wishes Jan
>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/4c315419-f010-4222-bf8c-09bb732d19d3o%40googlegroups.com.