fixed fs bug

master 1.1.6
宇天 2018-12-23 17:21:58 +08:00
parent 5af78262e7
commit 5c8ec8e024
2 changed files with 10 additions and 13 deletions

View File

@ -133,11 +133,11 @@ module.exports = {
* @param {Str} file [文件路径] * @param {Str} file [文件路径]
*/ */
md5Sign(file) { md5Sign(file) {
if (!fs.existsSync(file)) { if (!FS.existsSync(file)) {
return null return null
} }
let fileStream = fs.readFileSync(file) let fileStream = FS.readFileSync(file)
return this.hash('md5', fileStream) return this.hash('md5', fileStream)
}, },
@ -162,11 +162,11 @@ module.exports = {
* @param {Str} file [文件路径] * @param {Str} file [文件路径]
*/ */
sha1Sign(file) { sha1Sign(file) {
if (!fs.existsSync(file)) { if (!FS.existsSync(file)) {
return null return null
} }
let fileStream = fs.readFileSync(file) let fileStream = FS.readFileSync(file)
return this.hash('sha1', fileStream) return this.hash('sha1', fileStream)
}, },

View File

@ -1,16 +1,13 @@
{ {
"name": "crypto.js", "name": "crypto.js",
"version": "1.1.5", "version": "1.1.6",
"description": "原生crypto加密模块的二次封装,简化常用加密函数的使用", "description": "原生crypto加密模块的二次封装,简化常用加密函数的使用",
"keywords": [ "keywords": ["md5", "sha1", "base64", "fivejs", "crypto"],
"md5",
"sha1",
"base64",
"fivejs",
"crypto"
],
"author": "yutent <yutent@doui.cc>", "author": "yutent <yutent@doui.cc>",
"repository": { "type": "git", "url": "https://github.com/yutent/crypto.js.git" }, "repository": {
"type": "git",
"url": "https://github.com/yutent/crypto.js.git"
},
"dependencies": {}, "dependencies": {},
"devDependencies": {}, "devDependencies": {},
"main": "index.js" "main": "index.js"