Skip to content

Instantly share code, notes, and snippets.

@boxmein
Last active February 7, 2017 21:17
Show Gist options
  • Save boxmein/b8a9e8846da08098d1c1f7cf4c5f392f to your computer and use it in GitHub Desktop.
Save boxmein/b8a9e8846da08098d1c1f7cf4c5f392f to your computer and use it in GitHub Desktop.
Convert Node.js buffers from equals representation to Unicode
const convert = x => x.split(" ").map(e => e.split("=")[1].replace(/, /g, "")).map(e => String.fromCharCode(parseInt(e))).join("");
// Usage:
convert("0=65, 1=66, 2=66, 3=65"); // "ABBA"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment