title: Encoding in Lua like Python(ord function)
body: <p>I want to translate below code segment in Lua:</p>
  
  <pre><code>def toLong(s):
    ls = [ord(i) for i in s]
    l = len(ls) -1
    sum = 0
    for i, v in enumerate(ls):
        sum += v*(256**(l-i))
    return sum
  
  print(toLong("\x00\x00\x01f\xd3d\x80X"))
  </code></pre>
  
  <p>it prints the original number: <strong>1541144871000</strong></p>