Skip to content

Commit

Permalink
remove jshashes and use embedded crypto library
Browse files Browse the repository at this point in the history
  • Loading branch information
andreycizov committed Dec 5, 2018
1 parent f83e26e commit cbab02c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/sphinx-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { CompositeDisposable } from 'atom';
import Docker from 'dockerode';
import Hashes from 'jshashes';
import Crypto from 'crypto';
import FP from 'find-free-port';
import * as os from 'os';

Expand Down Expand Up @@ -67,8 +67,8 @@ export default {
},

getContainerName(serverPath) {
var hash = new Hashes.SHA256
var subName = hash.hex(serverPath);
var hash = Crypto.createHash('sha256');
var subName = hash.update(serverPath).digest('hex');
var subName = subName.substring(0, 12);

return 'sphinx-preview-' + subName;
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"dependencies": {
"atom-package-deps": "^4.3.1",
"dockerode": "^2.3.1",
"jshashes": "^1.0.7",
"find-free-port": "^2.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit cbab02c

Please sign in to comment.