From 454c0750358973b4e5fb685f17238c5b76c459d8 Mon Sep 17 00:00:00 2001 From: JD-Robbs Date: Mon, 9 Jan 2017 17:58:46 +0000 Subject: [PATCH] Adds initial test --- sha/sha1-tests.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sha/sha1-tests.ts diff --git a/sha/sha1-tests.ts b/sha/sha1-tests.ts new file mode 100644 index 0000000000..4952edb6c9 --- /dev/null +++ b/sha/sha1-tests.ts @@ -0,0 +1,33 @@ +/// + +import fs = require("fs"); +import sha1 = require("sha1"); +/** + * API + * md5(message) + * message -- String or Buffer + * returns String + * + * Usage + **************************************************** + * var sha1 = require('sha1'); * + * console.log(sha1('message')); * + **************************************************** + * This will print the following + * 6f9b9af3cd6e8b8a73c2cdced37fe9f59226e27d + * + * It supports buffers, too + **************************************************** + * var fs = require('fs'); * + * var sha1 = require('sha1'); * + * * + * fs.readFile('example.txt', function(err, buf) { * + * console.log(sha1(buf)); * + * }); * + * ************************************************** + */ +console.log(sha1('message')); // should print 6f9b9af3cd6e8b8a73c2cdced37fe9f59226e27d + +fs.readFile('sha1.d.ts', function(err: Error, buf: Buffer) { + console.log(sha1(buf)); +});