Last active
June 6, 2022 07:26
-
-
Save mr-pascal/99c316c176bd533fee64cc791c6b94f9 to your computer and use it in GitHub Desktop.
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
| // Original string | |
| const str = "This is a string"; | |
| // Create the buffer with "utf-8" encoding | |
| const buffer = Buffer.from(str, "utf-8"); | |
| // Output: <Buffer 54 68 69 73 20 69 73 20 61 20 73 74 72 69 6e 67> | |
| console.log(buffer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment