@@ -160,7 +160,7 @@ console.log(encrypted);
160
160
### cipher.final([ output_encoding] )
161
161
162
162
Returns any remaining enciphered contents. If ` output_encoding `
163
- parameter is one of ` 'binary ' ` , ` 'base64' ` or ` 'hex' ` , a string is returned.
163
+ parameter is one of ` 'latin1 ' ` , ` 'base64' ` or ` 'hex' ` , a string is returned.
164
164
If an ` output_encoding ` is not provided, a [ ` Buffer ` ] [ ] is returned.
165
165
166
166
Once the ` cipher.final() ` method has been called, the ` Cipher ` object can no
@@ -198,13 +198,13 @@ The `cipher.setAutoPadding()` method must be called before [`cipher.final()`][].
198
198
### cipher.update(data[ , input_encoding] [ , output_encoding ] )
199
199
200
200
Updates the cipher with ` data ` . If the ` input_encoding ` argument is given,
201
- it's value must be one of ` 'utf8' ` , ` 'ascii' ` , or ` 'binary ' ` and the ` data `
201
+ it's value must be one of ` 'utf8' ` , ` 'ascii' ` , or ` 'latin1 ' ` and the ` data `
202
202
argument is a string using the specified encoding. If the ` input_encoding `
203
203
argument is not given, ` data ` must be a [ ` Buffer ` ] [ ] . If ` data ` is a
204
204
[ ` Buffer ` ] [ ] then ` input_encoding ` is ignored.
205
205
206
206
The ` output_encoding ` specifies the output format of the enciphered
207
- data, and can be ` 'binary ' ` , ` 'base64' ` or ` 'hex' ` . If the ` output_encoding `
207
+ data, and can be ` 'latin1 ' ` , ` 'base64' ` or ` 'hex' ` . If the ` output_encoding `
208
208
is specified, a string using the specified encoding is returned. If no
209
209
` output_encoding ` is provided, a [ ` Buffer ` ] [ ] is returned.
210
210
@@ -277,7 +277,7 @@ console.log(decrypted);
277
277
### decipher.final([ output_encoding] )
278
278
279
279
Returns any remaining deciphered contents. If ` output_encoding `
280
- parameter is one of ` 'binary ' ` , ` 'base64' ` or ` 'hex' ` , a string is returned.
280
+ parameter is one of ` 'latin1 ' ` , ` 'base64' ` or ` 'hex' ` , a string is returned.
281
281
If an ` output_encoding ` is not provided, a [ ` Buffer ` ] [ ] is returned.
282
282
283
283
Once the ` decipher.final() ` method has been called, the ` Decipher ` object can
@@ -313,13 +313,13 @@ The `decipher.setAutoPadding()` method must be called before
313
313
### decipher.update(data[ , input_encoding] [ , output_encoding ] )
314
314
315
315
Updates the decipher with ` data ` . If the ` input_encoding ` argument is given,
316
- it's value must be one of ` 'binary ' ` , ` 'base64' ` , or ` 'hex' ` and the ` data `
316
+ it's value must be one of ` 'latin1 ' ` , ` 'base64' ` , or ` 'hex' ` and the ` data `
317
317
argument is a string using the specified encoding. If the ` input_encoding `
318
318
argument is not given, ` data ` must be a [ ` Buffer ` ] [ ] . If ` data ` is a
319
319
[ ` Buffer ` ] [ ] then ` input_encoding ` is ignored.
320
320
321
321
The ` output_encoding ` specifies the output format of the enciphered
322
- data, and can be ` 'binary ' ` , ` 'ascii' ` or ` 'utf8' ` . If the ` output_encoding `
322
+ data, and can be ` 'latin1 ' ` , ` 'ascii' ` or ` 'utf8' ` . If the ` output_encoding `
323
323
is specified, a string using the specified encoding is returned. If no
324
324
` output_encoding ` is provided, a [ ` Buffer ` ] [ ] is returned.
325
325
@@ -361,7 +361,7 @@ Computes the shared secret using `other_public_key` as the other
361
361
party's public key and returns the computed shared secret. The supplied
362
362
key is interpreted using the specified ` input_encoding ` , and secret is
363
363
encoded using specified ` output_encoding ` . Encodings can be
364
- ` 'binary ' ` , ` 'hex' ` , or ` 'base64' ` . If the ` input_encoding ` is not
364
+ ` 'latin1 ' ` , ` 'hex' ` , or ` 'base64' ` . If the ` input_encoding ` is not
365
365
provided, ` other_public_key ` is expected to be a [ ` Buffer ` ] [ ] .
366
366
367
367
If ` output_encoding ` is given a string is returned; otherwise, a
@@ -371,45 +371,45 @@ If `output_encoding` is given a string is returned; otherwise, a
371
371
372
372
Generates private and public Diffie-Hellman key values, and returns
373
373
the public key in the specified ` encoding ` . This key should be
374
- transferred to the other party. Encoding can be ` 'binary ' ` , ` 'hex' ` ,
374
+ transferred to the other party. Encoding can be ` 'latin1 ' ` , ` 'hex' ` ,
375
375
or ` 'base64' ` . If ` encoding ` is provided a string is returned; otherwise a
376
376
[ ` Buffer ` ] [ ] is returned.
377
377
378
378
### diffieHellman.getGenerator([ encoding] )
379
379
380
380
Returns the Diffie-Hellman generator in the specified ` encoding ` , which can
381
- be ` 'binary ' ` , ` 'hex' ` , or ` 'base64' ` . If ` encoding ` is provided a string is
381
+ be ` 'latin1 ' ` , ` 'hex' ` , or ` 'base64' ` . If ` encoding ` is provided a string is
382
382
returned; otherwise a [ ` Buffer ` ] [ ] is returned.
383
383
384
384
### diffieHellman.getPrime([ encoding] )
385
385
386
386
Returns the Diffie-Hellman prime in the specified ` encoding ` , which can
387
- be ` 'binary ' ` , ` 'hex' ` , or ` 'base64' ` . If ` encoding ` is provided a string is
387
+ be ` 'latin1 ' ` , ` 'hex' ` , or ` 'base64' ` . If ` encoding ` is provided a string is
388
388
returned; otherwise a [ ` Buffer ` ] [ ] is returned.
389
389
390
390
### diffieHellman.getPrivateKey([ encoding] )
391
391
392
392
Returns the Diffie-Hellman private key in the specified ` encoding ` ,
393
- which can be ` 'binary ' ` , ` 'hex' ` , or ` 'base64' ` . If ` encoding ` is provided a
393
+ which can be ` 'latin1 ' ` , ` 'hex' ` , or ` 'base64' ` . If ` encoding ` is provided a
394
394
string is returned; otherwise a [ ` Buffer ` ] [ ] is returned.
395
395
396
396
### diffieHellman.getPublicKey([ encoding] )
397
397
398
398
Returns the Diffie-Hellman public key in the specified ` encoding ` , which
399
- can be ` 'binary ' ` , ` 'hex' ` , or ` 'base64' ` . If ` encoding ` is provided a
399
+ can be ` 'latin1 ' ` , ` 'hex' ` , or ` 'base64' ` . If ` encoding ` is provided a
400
400
string is returned; otherwise a [ ` Buffer ` ] [ ] is returned.
401
401
402
402
### diffieHellman.setPrivateKey(private_key[ , encoding] )
403
403
404
404
Sets the Diffie-Hellman private key. If the ` encoding ` argument is provided
405
- and is either ` 'binary ' ` , ` 'hex' ` , or ` 'base64' ` , ` private_key ` is expected
405
+ and is either ` 'latin1 ' ` , ` 'hex' ` , or ` 'base64' ` , ` private_key ` is expected
406
406
to be a string. If no ` encoding ` is provided, ` private_key ` is expected
407
407
to be a [ ` Buffer ` ] [ ] .
408
408
409
409
### diffieHellman.setPublicKey(public_key[ , encoding] )
410
410
411
411
Sets the Diffie-Hellman public key. If the ` encoding ` argument is provided
412
- and is either ` 'binary ' ` , ` 'hex' ` or ` 'base64' ` , ` public_key ` is expected
412
+ and is either ` 'latin1 ' ` , ` 'hex' ` or ` 'base64' ` , ` public_key ` is expected
413
413
to be a string. If no ` encoding ` is provided, ` public_key ` is expected
414
414
to be a [ ` Buffer ` ] [ ] .
415
415
@@ -460,7 +460,7 @@ Computes the shared secret using `other_public_key` as the other
460
460
party's public key and returns the computed shared secret. The supplied
461
461
key is interpreted using specified ` input_encoding ` , and the returned secret
462
462
is encoded using the specified ` output_encoding ` . Encodings can be
463
- ` 'binary ' ` , ` 'hex' ` , or ` 'base64' ` . If the ` input_encoding ` is not
463
+ ` 'latin1 ' ` , ` 'hex' ` , or ` 'base64' ` . If the ` input_encoding ` is not
464
464
provided, ` other_public_key ` is expected to be a [ ` Buffer ` ] [ ] .
465
465
466
466
If ` output_encoding ` is given a string will be returned; otherwise a
@@ -476,14 +476,14 @@ The `format` arguments specifies point encoding and can be `'compressed'`,
476
476
` 'uncompressed' ` , or ` 'hybrid' ` . If ` format ` is not specified, the point will
477
477
be returned in ` 'uncompressed' ` format.
478
478
479
- The ` encoding ` argument can be ` 'binary ' ` , ` 'hex' ` , or ` 'base64' ` . If
479
+ The ` encoding ` argument can be ` 'latin1 ' ` , ` 'hex' ` , or ` 'base64' ` . If
480
480
` encoding ` is provided a string is returned; otherwise a [ ` Buffer ` ] [ ]
481
481
is returned.
482
482
483
483
### ecdh.getPrivateKey([ encoding] )
484
484
485
485
Returns the EC Diffie-Hellman private key in the specified ` encoding ` ,
486
- which can be ` 'binary ' ` , ` 'hex' ` , or ` 'base64' ` . If ` encoding ` is provided
486
+ which can be ` 'latin1 ' ` , ` 'hex' ` , or ` 'base64' ` . If ` encoding ` is provided
487
487
a string is returned; otherwise a [ ` Buffer ` ] [ ] is returned.
488
488
489
489
### ecdh.getPublicKey([ encoding[ , format]] )
@@ -495,13 +495,13 @@ The `format` argument specifies point encoding and can be `'compressed'`,
495
495
` 'uncompressed' ` , or ` 'hybrid' ` . If ` format ` is not specified the point will be
496
496
returned in ` 'uncompressed' ` format.
497
497
498
- The ` encoding ` argument can be ` 'binary ' ` , ` 'hex' ` , or ` 'base64' ` . If
498
+ The ` encoding ` argument can be ` 'latin1 ' ` , ` 'hex' ` , or ` 'base64' ` . If
499
499
` encoding ` is specified, a string is returned; otherwise a [ ` Buffer ` ] [ ] is
500
500
returned.
501
501
502
502
### ecdh.setPrivateKey(private_key[ , encoding] )
503
503
504
- Sets the EC Diffie-Hellman private key. The ` encoding ` can be ` 'binary ' ` ,
504
+ Sets the EC Diffie-Hellman private key. The ` encoding ` can be ` 'latin1 ' ` ,
505
505
` 'hex' ` or ` 'base64' ` . If ` encoding ` is provided, ` private_key ` is expected
506
506
to be a string; otherwise ` private_key ` is expected to be a [ ` Buffer ` ] [ ] . If
507
507
` private_key ` is not valid for the curve specified when the ` ECDH ` object was
@@ -512,7 +512,7 @@ public point (key) is also generated and set in the ECDH object.
512
512
513
513
Stability: 0 - Deprecated
514
514
515
- Sets the EC Diffie-Hellman public key. Key encoding can be ` 'binary ' ` ,
515
+ Sets the EC Diffie-Hellman public key. Key encoding can be ` 'latin1 ' ` ,
516
516
` 'hex' ` or ` 'base64' ` . If ` encoding ` is provided ` public_key ` is expected to
517
517
be a string; otherwise a [ ` Buffer ` ] [ ] is expected.
518
518
@@ -604,7 +604,7 @@ console.log(hash.digest('hex'));
604
604
### hash.digest([ encoding] )
605
605
606
606
Calculates the digest of all of the data passed to be hashed (using the
607
- [ ` hash.update() ` ] [ ] method). The ` encoding ` can be ` 'hex' ` , ` 'binary ' ` or
607
+ [ ` hash.update() ` ] [ ] method). The ` encoding ` can be ` 'hex' ` , ` 'latin1 ' ` or
608
608
` 'base64' ` . If ` encoding ` is provided a string will be returned; otherwise
609
609
a [ ` Buffer ` ] [ ] is returned.
610
610
@@ -615,7 +615,7 @@ called. Multiple calls will cause an error to be thrown.
615
615
616
616
Updates the hash content with the given ` data ` , the encoding of which
617
617
is given in ` input_encoding ` and can be ` 'utf8' ` , ` 'ascii' ` or
618
- ` 'binary ' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
618
+ ` 'latin1 ' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
619
619
encoding of ` 'utf8' ` is enforced. If ` data ` is a [ ` Buffer ` ] [ ] then
620
620
` input_encoding ` is ignored.
621
621
@@ -678,7 +678,7 @@ console.log(hmac.digest('hex'));
678
678
### hmac.digest([ encoding] )
679
679
680
680
Calculates the HMAC digest of all of the data passed using [ ` hmac.update() ` ] [ ] .
681
- The ` encoding ` can be ` 'hex' ` , ` 'binary ' ` or ` 'base64' ` . If ` encoding ` is
681
+ The ` encoding ` can be ` 'hex' ` , ` 'latin1 ' ` or ` 'base64' ` . If ` encoding ` is
682
682
provided a string is returned; otherwise a [ ` Buffer ` ] [ ] is returned;
683
683
684
684
The ` Hmac ` object can not be used again after ` hmac.digest() ` has been
@@ -688,7 +688,7 @@ called. Multiple calls to `hmac.digest()` will result in an error being thrown.
688
688
689
689
Updates the ` Hmac ` content with the given ` data ` , the encoding of which
690
690
is given in ` input_encoding ` and can be ` 'utf8' ` , ` 'ascii' ` or
691
- ` 'binary ' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
691
+ ` 'latin1 ' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
692
692
encoding of ` 'utf8' ` is enforced. If ` data ` is a [ ` Buffer ` ] [ ] then
693
693
` input_encoding ` is ignored.
694
694
@@ -768,7 +768,7 @@ object, it is interpreted as a hash containing two properties:
768
768
* ` key ` : {String} - PEM encoded private key
769
769
* ` passphrase ` : {String} - passphrase for the private key
770
770
771
- The ` output_format ` can specify one of ` 'binary ' ` , ` 'hex' ` or ` 'base64' ` . If
771
+ The ` output_format ` can specify one of ` 'latin1 ' ` , ` 'hex' ` or ` 'base64' ` . If
772
772
` output_format ` is provided a string is returned; otherwise a [ ` Buffer ` ] [ ] is
773
773
returned.
774
774
@@ -779,7 +779,7 @@ called. Multiple calls to `sign.sign()` will result in an error being thrown.
779
779
780
780
Updates the ` Sign ` content with the given ` data ` , the encoding of which
781
781
is given in ` input_encoding ` and can be ` 'utf8' ` , ` 'ascii' ` or
782
- ` 'binary ' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
782
+ ` 'latin1 ' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
783
783
encoding of ` 'utf8' ` is enforced. If ` data ` is a [ ` Buffer ` ] [ ] then
784
784
` input_encoding ` is ignored.
785
785
@@ -831,7 +831,7 @@ console.log(verify.verify(public_key, signature));
831
831
832
832
Updates the ` Verify ` content with the given ` data ` , the encoding of which
833
833
is given in ` input_encoding ` and can be ` 'utf8' ` , ` 'ascii' ` or
834
- ` 'binary ' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
834
+ ` 'latin1 ' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
835
835
encoding of ` 'utf8' ` is enforced. If ` data ` is a [ ` Buffer ` ] [ ] then
836
836
` input_encoding ` is ignored.
837
837
@@ -843,7 +843,7 @@ Verifies the provided data using the given `object` and `signature`.
843
843
The ` object ` argument is a string containing a PEM encoded object, which can be
844
844
one an RSA public key, a DSA public key, or an X.509 certificate.
845
845
The ` signature ` argument is the previously calculated signature for the data, in
846
- the ` signature_format ` which can be ` 'binary ' ` , ` 'hex' ` or ` 'base64' ` .
846
+ the ` signature_format ` which can be ` 'latin1 ' ` , ` 'hex' ` or ` 'base64' ` .
847
847
If a ` signature_format ` is specified, the ` signature ` is expected to be a
848
848
string; otherwise ` signature ` is expected to be a [ ` Buffer ` ] [ ] .
849
849
@@ -869,7 +869,7 @@ or [buffers][`Buffer`]. The default value is `'buffer'`, which makes methods
869
869
default to [ ` Buffer ` ] [ ] objects.
870
870
871
871
The ` crypto.DEFAULT_ENCODING ` mechanism is provided for backwards compatibility
872
- with legacy programs that expect ` 'binary ' ` to be the default encoding.
872
+ with legacy programs that expect ` 'latin1 ' ` to be the default encoding.
873
873
874
874
New applications should expect the default to be ` 'buffer' ` . This property may
875
875
become deprecated in a future Node.js release.
@@ -889,7 +889,7 @@ recent OpenSSL releases, `openssl list-cipher-algorithms` will display the
889
889
available cipher algorithms.
890
890
891
891
The ` password ` is used to derive the cipher key and initialization vector (IV).
892
- The value must be either a ` 'binary ' ` encoded string or a [ ` Buffer ` ] [ ] .
892
+ The value must be either a ` 'latin1 ' ` encoded string or a [ ` Buffer ` ] [ ] .
893
893
894
894
The implementation of ` crypto.createCipher() ` derives keys using the OpenSSL
895
895
function [ ` EVP_BytesToKey ` ] [ ] with the digest algorithm set to MD5, one
@@ -913,7 +913,7 @@ recent OpenSSL releases, `openssl list-cipher-algorithms` will display the
913
913
available cipher algorithms.
914
914
915
915
The ` key ` is the raw key used by the ` algorithm ` and ` iv ` is an
916
- [ initialization vector] [ ] . Both arguments must be ` 'binary ' ` encoded strings or
916
+ [ initialization vector] [ ] . Both arguments must be ` 'latin1 ' ` encoded strings or
917
917
[ buffers] [ `Buffer` ] .
918
918
919
919
### crypto.createCredentials(details)
@@ -968,7 +968,7 @@ recent OpenSSL releases, `openssl list-cipher-algorithms` will display the
968
968
available cipher algorithms.
969
969
970
970
The ` key ` is the raw key used by the ` algorithm ` and ` iv ` is an
971
- [ initialization vector] [ ] . Both arguments must be ` 'binary ' ` encoded strings or
971
+ [ initialization vector] [ ] . Both arguments must be ` 'latin1 ' ` encoded strings or
972
972
[ buffers] [ `Buffer` ] .
973
973
974
974
### crypto.createDiffieHellman(prime[ , prime_encoding] [ , generator ] [ , generator_encoding] )
@@ -979,7 +979,7 @@ optional specific `generator`.
979
979
The ` generator ` argument can be a number, string, or [ ` Buffer ` ] [ ] . If
980
980
` generator ` is not specified, the value ` 2 ` is used.
981
981
982
- The ` prime_encoding ` and ` generator_encoding ` arguments can be ` 'binary ' ` ,
982
+ The ` prime_encoding ` and ` generator_encoding ` arguments can be ` 'latin1 ' ` ,
983
983
` 'hex' ` , or ` 'base64' ` .
984
984
985
985
If ` prime_encoding ` is specified, ` prime ` is expected to be a string; otherwise
@@ -1345,7 +1345,7 @@ unified Stream API, and before there were [`Buffer`][] objects for handling
1345
1345
binary data. As such, the many of the ` crypto ` defined classes have methods not
1346
1346
typically found on other Node.js classes that implement the [ streams] [ stream ]
1347
1347
API (e.g. ` update() ` , ` final() ` , or ` digest() ` ). Also, many methods accepted
1348
- and returned ` 'binary ' ` encoded strings by default rather than Buffers. This
1348
+ and returned ` 'latin1 ' ` encoded strings by default rather than Buffers. This
1349
1349
default was changed after Node.js v0.8 to use [ ` Buffer ` ] [ ] objects by default
1350
1350
instead.
1351
1351
0 commit comments