Why to use Buffers instead of binary strings to handle binary data?

Technology CommunityCategory: Node.jsWhy to use Buffers instead of binary strings to handle binary data?
VietMX Staff asked 3 years ago

Pure JavaScript does not able to handle straight binary data very well. Since Node.js servers have to deal with TCP streams for reading and writing of data, binary strings will become problematic to work with as it is very slow and has a tendency to break. That’s why it is always advisable to use Buffers instead of binary strings to handle binary data.