summaryrefslogtreecommitdiff
path: root/src/lstring.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lstring.js')
-rw-r--r--src/lstring.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lstring.js b/src/lstring.js
index 84754f0..d65fc6a 100644
--- a/src/lstring.js
+++ b/src/lstring.js
@@ -31,7 +31,11 @@ const luaS_eqlngstr = function(a, b) {
make sure this doesn't conflict with any of the anti-collision strategies in ltable */
const luaS_hash = function(str) {
assert(defs.is_luastring(str));
- return '|'+str.toString();
+ let len = str.length;
+ let s = "|";
+ for (let i=0; i<len; i++)
+ s += str[i].toString(16);
+ return s;
};
const luaS_hashlongstr = function(ts) {