mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-07 16:30:12 +08:00
Merge pull request #1880 from jpmoodlerooms/node_crypto
Update crypto.Hmac.update and crypto.Hmac.digest methods to the correct signature
This commit is contained in:
@@ -6,6 +6,7 @@ import events = require("events");
|
||||
import zlib = require("zlib");
|
||||
import url = require('url');
|
||||
import util = require("util");
|
||||
import crypto = require("crypto");
|
||||
|
||||
assert(1 + 1 - 2 === 0, "The universe isn't how it should.");
|
||||
|
||||
@@ -80,3 +81,10 @@ function stream_readable_pipe_test() {
|
||||
var w = fs.createWriteStream('file.txt.gz');
|
||||
r.pipe(z).pipe(w);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
/// Crypto tests : http://nodejs.org/api/crypto.html
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').digest('hex');
|
||||
|
||||
Vendored
+2
-2
@@ -1021,8 +1021,8 @@ declare module "crypto" {
|
||||
digest(encoding?: string): string;
|
||||
}
|
||||
interface Hmac {
|
||||
update(data: any): void;
|
||||
digest(encoding?: string): void;
|
||||
update(data: any, input_encoding?: string): Hmac;
|
||||
digest(encoding?: string): string;
|
||||
}
|
||||
export function createCipher(algorithm: string, password: any): Cipher;
|
||||
export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
|
||||
|
||||
Reference in New Issue
Block a user