Skip to content

Commit

Permalink
Merge pull request DefinitelyTyped#1880 from jpmoodlerooms/node_crypto
Browse files Browse the repository at this point in the history
Update crypto.Hmac.update and crypto.Hmac.digest methods to the correct signature
  • Loading branch information
vvakame committed Apr 1, 2014
2 parents 118fea7 + 941d790 commit a4ceaf4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions node/node-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.");

Expand Down Expand Up @@ -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');
4 changes: 2 additions & 2 deletions node/node.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a4ceaf4

Please sign in to comment.