lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi;

How can I convert bytes array to string efficiently in Lua?
or must I extend with C?

a sample I wrote:

function bytestostring (bytes)
  s = ""
  for i=1,getn(bytes) do
    s = s..strchar(bytes[i])  -- '..' create new string. Expensive!!
  end
  return s
end


Thanks.

-- 
SATO Seichi