Last active
February 7, 2017 21:17
-
-
Save boxmein/b8a9e8846da08098d1c1f7cf4c5f392f to your computer and use it in GitHub Desktop.
Convert Node.js buffers from equals representation to Unicode
This file contains hidden or 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
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