Guest User

Untitled

a guest
Jun 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. function utf8ToString(h, p) {
  2. let s = "";
  3. for (i = p; h[i]; i++) {
  4. s += String.fromCharCode(h[i]);
  5. }
  6. return s;
  7. }
  8.  
  9. let m = new WebAssembly.Instance(new WebAssembly.Module(buffer));
  10. let h = new Uint8Array(m.exports.memory.buffer);
  11. let p = m.exports.hello();
  12. const value = utf8ToString(h, p);
  13.  
  14. console.log(value)
Add Comment
Please, Sign In to add comment