Adds initial test

This commit is contained in:
JD-Robbs
2017-01-09 17:58:46 +00:00
committed by GitHub
parent 8f1c02df74
commit 454c075035
+33
View File
@@ -0,0 +1,33 @@
/// <reference types="node" />
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));
});