@@ -669,10 +669,15 @@ provided a string is returned; otherwise a [`Buffer`][] is returned;
669
669
The ` Hmac ` object can not be used again after ` hmac.digest() ` has been
670
670
called. Multiple calls to ` hmac.digest() ` will result in an error being thrown.
671
671
672
- ### hmac.update(data)
672
+ ### hmac.update(data[ , input_encoding ] )
673
673
674
- Update the ` Hmac ` content with the given ` data ` . This can be called
675
- many times with new data as it is streamed.
674
+ Updates the ` Hmac ` content with the given ` data ` , the encoding of which
675
+ is given in ` input_encoding ` and can be ` 'utf8' ` , ` 'ascii' ` or
676
+ ` 'binary' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
677
+ encoding of ` 'utf8' ` is enforced. If ` data ` is a [ ` Buffer ` ] [ ] then
678
+ ` input_encoding ` is ignored.
679
+
680
+ This can be called many times with new data as it is streamed.
676
681
677
682
## Class: Sign
678
683
@@ -733,10 +738,15 @@ returned.
733
738
The ` Sign ` object can not be again used after ` sign.sign() ` method has been
734
739
called. Multiple calls to ` sign.sign() ` will result in an error being thrown.
735
740
736
- ### sign.update(data)
741
+ ### sign.update(data[ , input_encoding] )
742
+
743
+ Updates the ` Sign ` content with the given ` data ` , the encoding of which
744
+ is given in ` input_encoding ` and can be ` 'utf8' ` , ` 'ascii' ` or
745
+ ` 'binary' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
746
+ encoding of ` 'utf8' ` is enforced. If ` data ` is a [ ` Buffer ` ] [ ] then
747
+ ` input_encoding ` is ignored.
737
748
738
- Updates the sign object with the given ` data ` . This can be called many times
739
- with new data as it is streamed.
749
+ This can be called many times with new data as it is streamed.
740
750
741
751
## Class: Verify
742
752
@@ -780,10 +790,15 @@ console.log(verify.verify(public_key, signature));
780
790
// Prints true or false
781
791
```
782
792
783
- ### verifier.update(data)
793
+ ### verifier.update(data[ , input_encoding ] )
784
794
785
- Updates the verifier object with the given ` data ` . This can be called many
786
- times with new data as it is streamed.
795
+ Updates the ` Verify ` content with the given ` data ` , the encoding of which
796
+ is given in ` input_encoding ` and can be ` 'utf8' ` , ` 'ascii' ` or
797
+ ` 'binary' ` . If ` encoding ` is not provided, and the ` data ` is a string, an
798
+ encoding of ` 'utf8' ` is enforced. If ` data ` is a [ ` Buffer ` ] [ ] then
799
+ ` input_encoding ` is ignored.
800
+
801
+ This can be called many times with new data as it is streamed.
787
802
788
803
### verifier.verify(object, signature[ , signature_format] )
789
804
@@ -811,7 +826,7 @@ or [buffers][`Buffer`]. The default value is `'buffer'`, which makes methods
811
826
default to [ ` Buffer ` ] [ ] objects.
812
827
813
828
The ` crypto.DEFAULT_ENCODING ` mechanism is provided for backwards compatibility
814
- with legacy programs that expect ` 'utf8 ' ` to be the default encoding.
829
+ with legacy programs that expect ` 'binary ' ` to be the default encoding.
815
830
816
831
New applications should expect the default to be ` 'buffer' ` . This property may
817
832
become deprecated in a future Node.js release.
0 commit comments