diff options
author | James M Snell <jasnell@gmail.com> | 2016-01-25 15:00:06 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2016-03-16 08:34:02 -0700 |
commit | 85ab4a5f1281c4e1dd06450ac7bd3250326267fa (patch) | |
tree | 7a51edfc5d6efc231cf821d575c9ca4a26d0545f /test/parallel/test-https-resume-after-renew.js | |
parent | 90a5fc20be22b4278a01bc58acba0cb732da0140 (diff) | |
download | android-node-v8-85ab4a5f1281c4e1dd06450ac7bd3250326267fa.tar.gz android-node-v8-85ab4a5f1281c4e1dd06450ac7bd3250326267fa.tar.bz2 android-node-v8-85ab4a5f1281c4e1dd06450ac7bd3250326267fa.zip |
buffer: add .from(), .alloc() and .allocUnsafe()
Several changes:
* Soft-Deprecate Buffer() constructors
* Add `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()`
* Add `--zero-fill-buffers` command line option
* Add byteOffset and length to `new Buffer(arrayBuffer)` constructor
* buffer.fill('') previously had no effect, now zero-fills
* Update the docs
PR-URL: https://github.com/nodejs/node/pull/4682
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Diffstat (limited to 'test/parallel/test-https-resume-after-renew.js')
-rw-r--r-- | test/parallel/test-https-resume-after-renew.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/parallel/test-https-resume-after-renew.js b/test/parallel/test-https-resume-after-renew.js index 23626ccb40..6a1238f6e8 100644 --- a/test/parallel/test-https-resume-after-renew.js +++ b/test/parallel/test-https-resume-after-renew.js @@ -14,17 +14,14 @@ var server = https.createServer(options, function(req, res) { res.end('hello'); }); -var aes = new Buffer(16); -aes.fill('S'); -var hmac = new Buffer(16); -hmac.fill('H'); +var aes = Buffer.alloc(16, 'S'); +var hmac = Buffer.alloc(16, 'H'); server._sharedCreds.context.enableTicketKeyCallback(); server._sharedCreds.context.onticketkeycallback = function(name, iv, enc) { if (enc) { - var newName = new Buffer(16); + var newName = Buffer.alloc(16, 'A'); var newIV = crypto.randomBytes(16); - newName.fill('A'); } else { // Renew return [ 2, hmac, aes ]; |