-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.
Description
- v4.6.1, 4.5.0, 4.6.0:
- Darwin Kernel Version 16.0.0; root:xnu-3789.1.32~3/RELEASE_X86_64 x86_64:
Buffer.alloc(size, data, enc)
:
$ node
> let s = 'YQ=='
undefined
> Buffer.alloc(s.length, s, 'base64')
<Buffer 00 00 00 00>
> Buffer(s, 'base64')
<Buffer 61>
> Buffer.alloc(1, s, 'base64')
<Buffer 00>
> Buffer(s, 'base64').toString('base64')
'YQ=='
> let b = Buffer(s.length); b.write(s, 'base64'); b
<Buffer 61 00 00 00>
> b.toString('base64')
'YQAAAA=='
Also, the Buffer.alloc(size, data, enc)
docs example fails:
> Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
<Buffer 00 00 00 00 00 00 00 00 00 00 00>
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.