Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:RemiLib
(view source)
Revision as of 04:58, 25 October 2015
28 bytes added
,
9 years ago
no edit summary
Line 22:
Line 22:
function p.hashString(string)
function p.hashString(string)
local hash = 0
local hash = 0
−
for
letter in
string do
+
for
i = 1, #
string do
+
local letter = str:sub(i,i)
hash = bit32.lshift(hash,1)
hash = bit32.lshift(hash,1)
hash = hash+string.byte(letter) % (2^31-1)
hash = hash+string.byte(letter) % (2^31-1)
Remi Scarlet
2,922
edits