Created
February 28, 2014 03:00
-
-
Save amirhaleem/9264331 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$http.get('http://127.0.0.1:8077/').success(function(res){ | |
var buf = new ArrayBuffer(res.length / 2); | |
var bufView = new Uint8Array(buf); | |
for (var i=0, strLen=res.length; i<strLen; i++) { | |
var zIndex = i * 2; | |
var firstChar = res[zIndex]; | |
var secondChar = res[zIndex + 1]; | |
var combinedChar = firstChar + secondChar; | |
bufView[i] = parseInt(combinedChar, 16) | |
} | |
var decoded = msgpack.decode(bufView); | |
console.log(decoded.P); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment