Please do not deprecated Buffer "binary" encoding.

108 views
Skip to first unread message

Axel Kittenberger

unread,
Feb 7, 2015, 9:27:34 AM2/7/15
to nodejs
I just read through the docs that say, buffer.toString( 'binary') might be going to removed.

please don't.

I need immutable binary object in my data tree. Turning them to strings with binary encoding worked well. But buffers are not immutable by definition as replacement, and Object.freeze( ) on them won't work either.

Kind regards, Axel

mscdex

unread,
Feb 7, 2015, 10:39:49 PM2/7/15
to nod...@googlegroups.com
On Saturday, February 7, 2015 at 9:27:34 AM UTC-5, Axel Kittenberger wrote:
I just read through the docs that say, buffer.toString( 'binary') might be going to removed.

please don't.


That note has been in the docs for a long time and just from what I remember hearing the last time it was brought up for discussion, it's not going anywhere. One of the main advantages of the binary string encoding was that you could perform any operation where strings are accepted (e.g. execute regexp on it, use indexOf(), etc). However Buffer is starting to adopt some of these same string methods, so the missing functionality is becoming less and less of an issue.

Trevor Norris

unread,
Feb 8, 2015, 11:34:04 AM2/8/15
to nod...@googlegroups.com
No worry. It's not going anywhere. That's an old note that should be removed.

Axel Kittenberger

unread,
Feb 8, 2015, 1:28:53 PM2/8/15
to nodejs
When buffers can be frozen and are otherwise fully API compatible to strings I'm okay with them as replacement. Fully compatible includes for them to turn into JSON and mongo BSON fully transparent like strings.

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/e3fd0855-8a0c-4bd3-9d47-5279f9ac2fa2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages