diff options
author | Trevor Norris <trev.norris@gmail.com> | 2016-06-02 10:55:36 -0600 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2016-06-07 13:51:14 -0600 |
commit | 54cc7212df320f1e489edf8dbeabb167a71cbe67 (patch) | |
tree | 19764d4f8f0d84373bb9de96844043fad342c9c0 /test/parallel/test-crypto-binary-default.js | |
parent | c300ba22128ce8e675650adcd1f6b869dc1b5126 (diff) | |
download | android-node-v8-54cc7212df320f1e489edf8dbeabb167a71cbe67.tar.gz android-node-v8-54cc7212df320f1e489edf8dbeabb167a71cbe67.tar.bz2 android-node-v8-54cc7212df320f1e489edf8dbeabb167a71cbe67.zip |
buffer: introduce latin1 encoding term
When node began using the OneByte API (f150d56) it also switched to
officially supporting ISO-8859-1. Though at the time no new encoding
string was introduced.
Introduce the new encoding string 'latin1' to be more explicit. The
previous 'binary' and documented as an alias to 'latin1'. While many
tests have switched to use 'latin1', there are still plenty that do both
'binary' and 'latin1' checks side-by-side to ensure there is no
regression.
PR-URL: https://github.com/nodejs/node/pull/7111
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-crypto-binary-default.js')
-rw-r--r-- | test/parallel/test-crypto-binary-default.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index 74447ce69d..bca8e13dd5 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -14,7 +14,7 @@ var crypto = require('crypto'); var tls = require('tls'); const DH_NOT_SUITABLE_GENERATOR = crypto.constants.DH_NOT_SUITABLE_GENERATOR; -crypto.DEFAULT_ENCODING = 'binary'; +crypto.DEFAULT_ENCODING = 'latin1'; var fs = require('fs'); var path = require('path'); @@ -346,11 +346,11 @@ var a3 = crypto.createHash('sha512').update('Test123').digest(); // binary var a4 = crypto.createHash('sha1').update('Test123').digest('buffer'); if (!common.hasFipsCrypto) { - var a0 = crypto.createHash('md5').update('Test123').digest('binary'); + var a0 = crypto.createHash('md5').update('Test123').digest('latin1'); assert.equal( a0, 'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca\u00bd\u008c', - 'Test MD5 as binary' + 'Test MD5 as latin1' ); } @@ -364,7 +364,7 @@ assert.equal(a3, '\u00c1(4\u00f1\u0003\u001fd\u0097!O\'\u00d4C/&Qz\u00d4' + '\u00d6\u0092\u00a3\u00df\u00a2i\u00a1\u009b\n\n*\u000f' + '\u00d7\u00d6\u00a2\u00a8\u0085\u00e3<\u0083\u009c\u0093' + '\u00c2\u0006\u00da0\u00a1\u00879(G\u00ed\'', - 'Test SHA512 as assumed binary'); + 'Test SHA512 as assumed latin1'); assert.deepStrictEqual( a4, @@ -530,7 +530,7 @@ var dh2 = crypto.createDiffieHellman(p1, 'base64'); var key1 = dh1.generateKeys(); var key2 = dh2.generateKeys('hex'); var secret1 = dh1.computeSecret(key2, 'hex', 'base64'); -var secret2 = dh2.computeSecret(key1, 'binary', 'buffer'); +var secret2 = dh2.computeSecret(key1, 'latin1', 'buffer'); assert.equal(secret1, secret2.toString('base64')); |