2021-04-05, 02:25 AM
(This post was last modified: 2021-04-06, 03:59 AM by PutuSuhartawan.)
stock?udb_hash(buf[])?{
????new?length=strlen(buf);
????new?s1?=?1;
????new?s2?=?0;
????new?n;
????for?(n=0;?n<length;?n)
????{
???????s1?=?(s1??buf[n])?%?65521;
???????s2?=?(s2??s1)?????%?65521;
????}
????return?(s2?<<?16)??s1;
}?
????new?length=strlen(buf);
????new?s1?=?1;
????new?s2?=?0;
????new?n;
????for?(n=0;?n<length;?n)
????{
???????s1?=?(s1??buf[n])?%?65521;
???????s2?=?(s2??s1)?????%?65521;
????}
????return?(s2?<<?16)??s1;
}?