Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
5c2e01fe84 | |||
d348590e9a | |||
c908cd824b | |||
4a62342015 | |||
0a9a0d3e90 | |||
8d5238e23e | |||
9e5ce63c24 | |||
3921cbc8f8 | |||
1d917c6a96 | |||
c06ac22a59 |
@ -3,14 +3,14 @@ image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: "$CI_BUILD_STAGE"
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
@ -18,48 +18,65 @@ stages:
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
- npmci git mirror
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
snyk:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:snyk
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install -g snyk
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
|
||||
testLTS:
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci npm publish
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
@ -69,31 +86,35 @@ codequality:
|
||||
allow_failure: true
|
||||
script:
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||
tags:
|
||||
- docker
|
||||
- priv
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
@ -101,5 +122,5 @@ pages:
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
- public
|
||||
allow_failure: true
|
||||
|
@ -10,6 +10,7 @@
|
||||
}
|
||||
},
|
||||
"npmci": {
|
||||
"npmAccessLevel": "public"
|
||||
"npmAccessLevel": "public",
|
||||
"npmRegistryUrl": "verdaccio.lossless.one"
|
||||
}
|
||||
}
|
285
package-lock.json
generated
285
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smarthash",
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.5",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -73,7 +73,7 @@
|
||||
},
|
||||
"@pushrocks/consolecolor": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@pushrocks/consolecolor/-/consolecolor-2.0.1.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fconsolecolor/-/consolecolor-2.0.1.tgz",
|
||||
"integrity": "sha512-iOFCHVeFZ2OywbdwSxVI4/wokkcLrXVdHLgvMmkNhJ220eeLgjNZWx3EJo3vNW3zq5ybCSCUIq0878djBxrWpw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@ -82,7 +82,7 @@
|
||||
},
|
||||
"@pushrocks/early": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@pushrocks/early/-/early-3.0.3.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fearly/-/early-3.0.3.tgz",
|
||||
"integrity": "sha512-71/nwxTpqdp1glmHz4YaGusNl/XOOcPelAxC9RA6rpS/6280QyY2u4yx+mRdMrCzn7ruLYF5awbkS8llNZ94Pg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@ -92,21 +92,21 @@
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@pushrocks/smartpromise/-/smartpromise-2.0.5.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
|
||||
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@pushrocks/lik": {
|
||||
"version": "3.0.11",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.11.tgz",
|
||||
"integrity": "sha512-SDKRPj9+xBTqozlDPcA7O6BcccM1Tw/sXPVP+OnhNxCubDZ/L2kGNpPpqm43NJUoNxSSo5wdBw4N7MAFYCGdVg==",
|
||||
"version": "3.0.13",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.13.tgz",
|
||||
"integrity": "sha512-YDxYoh2UksEfUxcjSjTwLsW5j852E5FrMG62CUi1I7ZpBxf96b7P1t2pRWsQsNnHRz6FHckW/A1V6XKASB+jZA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/smartdelay": "^2.0.3",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@pushrocks/smartrx": "^2.0.3",
|
||||
"@pushrocks/smartdelay": "^2.0.6",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@pushrocks/smartrx": "^2.0.5",
|
||||
"@pushrocks/smarttime": "^3.0.12",
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"minimatch": "^3.0.4",
|
||||
@ -137,12 +137,12 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartdelay": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdelay/-/smartdelay-2.0.3.tgz",
|
||||
"integrity": "sha512-TXKDDqsc7sBTLl+oiYNaF6IdNk1n70i8ur8QfwcUU6tegTnrEkvMWy9h5Zdty/fq1ioCNpKLvuXoA+fgYVwKGQ==",
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdelay/-/smartdelay-2.0.6.tgz",
|
||||
"integrity": "sha512-4wUnzWNhRPODpaaL5GuRaje/C5dg+TMhBxmr57PKc2fqYpy6azWJwonf/s5xpcbJLCPJRbj1x8M5MqgCFq2uvg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/smartpromise": "^3.0.2"
|
||||
"@pushrocks/smartpromise": "^3.0.6"
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartevent": {
|
||||
@ -190,24 +190,24 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/smarthash": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarthash/-/smarthash-2.0.6.tgz",
|
||||
"integrity": "sha512-jHk9srgRLkszk/oPCUOkxTX2Fqu7qKwx13aEeSIBx8UCtFbXPLecJAqEaGEVk1mw9e4Oq0iC6O0jEnxKo5NQwA==",
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarthash/-/smarthash-2.1.1.tgz",
|
||||
"integrity": "sha512-zVfqXsi0T+PZQJpXsQf7KJpoCUOv97q7//ccp5o/07Bo77gjLO966fevYO+1y7pbvLZ0nQ4pE536YmLkgwluPQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/smartjson": "^3.0.5",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"@pushrocks/smartjson": "^3.0.8",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@types/through2": "^2.0.34",
|
||||
"through2": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartjson": {
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartjson/-/smartjson-3.0.8.tgz",
|
||||
"integrity": "sha512-EjC3611RSZaZmK+nXxXrYDBxdxYWtrxjOrZtQzbYn0yM33KSCH0sLIAG8B2wYZVAOj4A2pC8mVxFSJ1w3iRFHg==",
|
||||
"version": "3.0.9",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartjson/-/smartjson-3.0.9.tgz",
|
||||
"integrity": "sha512-KAWMUpUY5a5WWRxlE0YQiJhbEQ9wOUWs/Iyv+S1cxYx//javChKai6kwvRMVEfEn/xRcFqGgSGJW5RspcL0s/g==",
|
||||
"requires": {
|
||||
"@types/fast-json-stable-stringify": "^2.0.0",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"fast-json-stable-stringify": "^2.1.0",
|
||||
"lodash.clonedeep": "^4.5.0"
|
||||
}
|
||||
},
|
||||
@ -270,9 +270,9 @@
|
||||
"integrity": "sha512-vlQlBGNVIjfClgnsfgQBU6GIKcskYSFzEcKLt18ngPzPEcjKklXcxaqzLXpnoxR+KBh30QPE8255ncYHXuPPOg=="
|
||||
},
|
||||
"@pushrocks/smartrequest": {
|
||||
"version": "1.1.42",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrequest/-/smartrequest-1.1.42.tgz",
|
||||
"integrity": "sha512-sCEousyvnbW9IvBVHt3ZTjV1IP2vxJQ8TqG5GqxRk82wyVB0SCZfuMWW/guQA1+DmxfUfMsqBxzvovtM/bOc1w==",
|
||||
"version": "1.1.43",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrequest/-/smartrequest-1.1.43.tgz",
|
||||
"integrity": "sha512-bgzzKN9SxJaYhh+BN3tuLSgdphWsxAOHgNjWWay3o/ib8/c2RwRlmjoxzxXrIhKFEwJjGIo7w04045VgkoWkMQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/smartpromise": "^3.0.5",
|
||||
@ -330,98 +330,12 @@
|
||||
"@pushrocks/smartfile": "^7.0.6",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"smartchai": "^2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartfile": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartfile/-/smartfile-7.0.6.tgz",
|
||||
"integrity": "sha512-X1kWg1HSQ/MqasRIHPCf6D9CRrcIrpTjW8KLc4GkApJ/W/IVaKsQkJQfdimlg1uc/9v8AYnoRdiGa51yxyghZA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/smarthash": "^2.0.6",
|
||||
"@pushrocks/smartpath": "^4.0.1",
|
||||
"@pushrocks/smartpromise": "^3.0.5",
|
||||
"@pushrocks/smartrequest": "^1.1.27",
|
||||
"@types/fs-extra": "^8.0.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
"glob": "^7.1.4",
|
||||
"js-yaml": "^3.13.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-3.0.6.tgz",
|
||||
"integrity": "sha512-vlQlBGNVIjfClgnsfgQBU6GIKcskYSFzEcKLt18ngPzPEcjKklXcxaqzLXpnoxR+KBh30QPE8255ncYHXuPPOg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartrequest": {
|
||||
"version": "1.1.42",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrequest/-/smartrequest-1.1.42.tgz",
|
||||
"integrity": "sha512-sCEousyvnbW9IvBVHt3ZTjV1IP2vxJQ8TqG5GqxRk82wyVB0SCZfuMWW/guQA1+DmxfUfMsqBxzvovtM/bOc1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/smartpromise": "^3.0.5",
|
||||
"@types/form-data": "^2.5.0",
|
||||
"agentkeepalive": "^4.0.2",
|
||||
"form-data": "^2.5.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-3.0.6.tgz",
|
||||
"integrity": "sha512-vlQlBGNVIjfClgnsfgQBU6GIKcskYSFzEcKLt18ngPzPEcjKklXcxaqzLXpnoxR+KBh30QPE8255ncYHXuPPOg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@types/form-data": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fform-data/-/form-data-2.5.0.tgz",
|
||||
"integrity": "sha512-23/wYiuckYYtFpL+4RPWiWmRQH2BjFuqCUi2+N3amB1a1Drv+i/byTrGvlLwRVLFNAZbwpbQ7JvTK+VCAPMbcg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"form-data": "*"
|
||||
}
|
||||
},
|
||||
"@types/fs-extra": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2ffs-extra/-/fs-extra-8.0.1.tgz",
|
||||
"integrity": "sha512-J00cVDALmi/hJOYsunyT52Hva5TnJeKP5yd1r+mH/ZU0mbYZflR0Z5kw5kITtKTRYMhm1JMClOFYdHnQszEvqw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"form-data": {
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://verdaccio.lossless.one/form-data/-/form-data-2.5.1.tgz",
|
||||
"integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.6",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://verdaccio.lossless.one/fs-extra/-/fs-extra-8.1.0.tgz",
|
||||
"integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^4.0.0",
|
||||
"universalify": "^0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@types/chai": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.2.5.tgz",
|
||||
"integrity": "sha512-YvbLiIc0DbbhiANrfVObdkLEHJksQZVq0Uvfg550SRAKVYaEJy+V70j65BVe2WNp6E3HtKsUczeijHFCjba3og==",
|
||||
"version": "4.2.7",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.2.7.tgz",
|
||||
"integrity": "sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/chai-as-promised": {
|
||||
@ -497,9 +411,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "12.12.11",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.12.11.tgz",
|
||||
"integrity": "sha512-O+x6uIpa6oMNTkPuHDa9MhMMehlxLAd5QcOvKRjAFsBVpeFWTOPnXbDvILvFgFFZfQ1xh1EZi1FbXxUix+zpsQ=="
|
||||
"version": "12.12.17",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.12.17.tgz",
|
||||
"integrity": "sha512-Is+l3mcHvs47sKy+afn2O1rV4ldZFU7W8101cNlOd+MRbjM4Onida8jSZnJdTe/0Pcf25g9BNIUsuugmE6puHA=="
|
||||
},
|
||||
"@types/through2": {
|
||||
"version": "2.0.34",
|
||||
@ -534,7 +448,7 @@
|
||||
},
|
||||
"ansi-256-colors": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz",
|
||||
"integrity": "sha1-kQ3lDvzHwJ49gvL4er1rcAwYgYo=",
|
||||
"dev": true
|
||||
},
|
||||
@ -554,9 +468,9 @@
|
||||
}
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://verdaccio.lossless.one/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://verdaccio.lossless.one/arg/-/arg-4.1.2.tgz",
|
||||
"integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==",
|
||||
"dev": true
|
||||
},
|
||||
"argparse": {
|
||||
@ -570,7 +484,7 @@
|
||||
},
|
||||
"assertion-error": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/assertion-error/-/assertion-error-1.1.0.tgz",
|
||||
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
|
||||
"dev": true
|
||||
},
|
||||
@ -630,7 +544,7 @@
|
||||
},
|
||||
"chai-as-promised": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/chai-as-promised/-/chai-as-promised-7.1.1.tgz",
|
||||
"integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@ -639,7 +553,7 @@
|
||||
},
|
||||
"chai-string": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.5.0.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/chai-string/-/chai-string-1.5.0.tgz",
|
||||
"integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==",
|
||||
"dev": true
|
||||
},
|
||||
@ -656,7 +570,7 @@
|
||||
},
|
||||
"check-error": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/check-error/-/check-error-1.0.2.tgz",
|
||||
"integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=",
|
||||
"dev": true
|
||||
},
|
||||
@ -734,11 +648,6 @@
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
|
||||
},
|
||||
"cron": {
|
||||
"version": "1.7.2",
|
||||
"resolved": "https://verdaccio.lossless.one/cron/-/cron-1.7.2.tgz",
|
||||
@ -778,7 +687,7 @@
|
||||
},
|
||||
"deep-eql": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/deep-eql/-/deep-eql-3.0.1.tgz",
|
||||
"integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@ -855,9 +764,9 @@
|
||||
}
|
||||
},
|
||||
"fast-json-stable-stringify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
|
||||
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://verdaccio.lossless.one/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
|
||||
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
|
||||
},
|
||||
"figures": {
|
||||
"version": "3.1.0",
|
||||
@ -913,7 +822,7 @@
|
||||
},
|
||||
"get-func-name": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/get-func-name/-/get-func-name-2.0.0.tgz",
|
||||
"integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=",
|
||||
"dev": true
|
||||
},
|
||||
@ -927,9 +836,9 @@
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.4",
|
||||
"resolved": "https://verdaccio.lossless.one/glob/-/glob-7.1.4.tgz",
|
||||
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://verdaccio.lossless.one/glob/-/glob-7.1.6.tgz",
|
||||
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
@ -941,9 +850,9 @@
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://verdaccio.lossless.one/graceful-fs/-/graceful-fs-4.2.0.tgz",
|
||||
"integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==",
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://verdaccio.lossless.one/graceful-fs/-/graceful-fs-4.2.3.tgz",
|
||||
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==",
|
||||
"dev": true
|
||||
},
|
||||
"has-flag": {
|
||||
@ -972,9 +881,9 @@
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://verdaccio.lossless.one/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"invert-kv": {
|
||||
"version": "2.0.0",
|
||||
@ -1000,11 +909,6 @@
|
||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
|
||||
"dev": true
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/isexe/-/isexe-2.0.0.tgz",
|
||||
@ -1070,9 +974,9 @@
|
||||
}
|
||||
},
|
||||
"luxon": {
|
||||
"version": "1.21.2",
|
||||
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.21.2.tgz",
|
||||
"integrity": "sha512-yshwnlkA79WfC24/BC9Rd1n0mhorP22Sc7GYn0puRU6wD/douCgNJIzI9qQBuT9m2/bU+n9v1RflVNE4rMPPxQ==",
|
||||
"version": "1.21.3",
|
||||
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.21.3.tgz",
|
||||
"integrity": "sha512-lLRwNcNnkZLuv13A1FUuZRZmTWF7ro2ricYvb0L9cvBYHPvZhQdKwrYnZzi103D2XKmlVmxWpdn2wfIiOt2YEw==",
|
||||
"dev": true
|
||||
},
|
||||
"make-error": {
|
||||
@ -1102,18 +1006,18 @@
|
||||
}
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.40.0",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-db/-/mime-db-1.40.0.tgz",
|
||||
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==",
|
||||
"version": "1.42.0",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-db/-/mime-db-1.42.0.tgz",
|
||||
"integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==",
|
||||
"dev": true
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.24",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-types/-/mime-types-2.1.24.tgz",
|
||||
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
|
||||
"version": "2.1.25",
|
||||
"resolved": "https://verdaccio.lossless.one/mime-types/-/mime-types-2.1.25.tgz",
|
||||
"integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mime-db": "1.40.0"
|
||||
"mime-db": "1.42.0"
|
||||
}
|
||||
},
|
||||
"mimic-fn": {
|
||||
@ -1324,15 +1228,10 @@
|
||||
},
|
||||
"pathval": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/pathval/-/pathval-1.1.0.tgz",
|
||||
"integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=",
|
||||
"dev": true
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
||||
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
|
||||
},
|
||||
"pump": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/pump/-/pump-3.0.0.tgz",
|
||||
@ -1344,17 +1243,13 @@
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.6",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
|
||||
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://verdaccio.lossless.one/readable-stream/-/readable-stream-3.4.0.tgz",
|
||||
"integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
|
||||
"requires": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"require-directory": {
|
||||
@ -1370,9 +1265,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.12.0",
|
||||
"resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.12.0.tgz",
|
||||
"integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==",
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.13.1.tgz",
|
||||
"integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"path-parse": "^1.0.6"
|
||||
@ -1398,9 +1293,9 @@
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://verdaccio.lossless.one/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.7.1",
|
||||
@ -1437,7 +1332,7 @@
|
||||
},
|
||||
"smartchai": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/smartchai/-/smartchai-2.0.1.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/smartchai/-/smartchai-2.0.1.tgz",
|
||||
"integrity": "sha512-9M+R56OhAHXScxgr2vzQqxGx0XMS0QXriNZuP7hjlbVbo2FUT+l60iEzbwPt9Ga+5u2cEEjSSoZEQVqlROaddA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@ -1482,11 +1377,11 @@
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://verdaccio.lossless.one/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
@ -1528,9 +1423,9 @@
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.5.2",
|
||||
"resolved": "https://verdaccio.lossless.one/ts-node/-/ts-node-8.5.2.tgz",
|
||||
"integrity": "sha512-W1DK/a6BGoV/D4x/SXXm6TSQx6q3blECUzd5TN+j56YEMX3yPVMpHsICLedUw3DvGF3aTQ8hfdR9AKMaHjIi+A==",
|
||||
"version": "8.5.4",
|
||||
"resolved": "https://verdaccio.lossless.one/ts-node/-/ts-node-8.5.4.tgz",
|
||||
"integrity": "sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
@ -1584,14 +1479,14 @@
|
||||
},
|
||||
"type-detect": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/type-detect/-/type-detect-4.0.8.tgz",
|
||||
"integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
|
||||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://verdaccio.lossless.one/typescript/-/typescript-3.7.2.tgz",
|
||||
"integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==",
|
||||
"version": "3.7.3",
|
||||
"resolved": "https://verdaccio.lossless.one/typescript/-/typescript-3.7.3.tgz",
|
||||
"integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==",
|
||||
"dev": true
|
||||
},
|
||||
"universalify": {
|
||||
@ -1602,7 +1497,7 @@
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"resolved": "https://verdaccio.lossless.one/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"wcwidth": {
|
||||
|
17
package.json
17
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smarthash",
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.5",
|
||||
"private": false,
|
||||
"description": "simplified access to node hash functions",
|
||||
"main": "dist/index.js",
|
||||
@ -33,22 +33,23 @@
|
||||
"@gitzone/tsrun": "^1.2.8",
|
||||
"@gitzone/tstest": "^1.0.28",
|
||||
"@pushrocks/tapbundle": "^3.2.0",
|
||||
"@types/node": "^12.12.11",
|
||||
"@types/node": "^12.12.17",
|
||||
"tslint": "^5.20.1",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartjson": "^3.0.8",
|
||||
"@pushrocks/smartjson": "^3.0.9",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@types/through2": "^2.0.34",
|
||||
"through2": "^3.0.1"
|
||||
},
|
||||
"files": [
|
||||
"ts/*",
|
||||
"ts_web/*",
|
||||
"dist/*",
|
||||
"dist_web/*",
|
||||
"assets/*",
|
||||
"ts/**/*",
|
||||
"ts_web/**/*",
|
||||
"dist/**/*",
|
||||
"dist_web/**/*",
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
|
@ -21,33 +21,48 @@ simplifies access to node hash functions
|
||||
We recommend the use of TypeScript for best in class intellisense.
|
||||
|
||||
```typescript
|
||||
import * as nodehash from "nodehash";
|
||||
import * as smarthash from "smarthash";
|
||||
|
||||
// ======
|
||||
// sha265
|
||||
// ======
|
||||
|
||||
// from stream
|
||||
let readStream = fs.createReadStream("./somefile.txt")
|
||||
nodehash.sha256FromStream(readStream)
|
||||
smarthash.sha256FromStream(readStream)
|
||||
.then((resultString){
|
||||
console.log(resultString); // prints hash of the file
|
||||
});
|
||||
|
||||
// from file
|
||||
nodehash.sha256FromFile("./somefile.txt")
|
||||
smarthash.sha256FromFile("./somefile.txt")
|
||||
.then((resultString){
|
||||
console.log(resultString); // prints hash of the file
|
||||
});
|
||||
|
||||
// from string
|
||||
nodehash.sha256FromString("some weird random string")
|
||||
smarthash.sha256FromString("some weird random string")
|
||||
.then((resultString){
|
||||
console.log(resultString); // prints hash of the file
|
||||
});
|
||||
|
||||
let hashString = nodehash.sha256FromStringSync("some weird random string");
|
||||
let hashString = smarthash.sha256FromStringSync("some weird random string");
|
||||
|
||||
// ===
|
||||
// md5
|
||||
// ===
|
||||
smarthash.md5FromString('hellothere').then(md5String = {
|
||||
// do something with it here
|
||||
})
|
||||
```
|
||||
|
||||
## Contribution
|
||||
|
||||
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
[](https://maintainedby.lossless.com)
|
12
test/test.ts
12
test/test.ts
@ -30,18 +30,18 @@ tap.test('sha256fromFile should convert a Stream to sha256', async () => {
|
||||
|
||||
tap.test('should produce reproducible hash from Object', async () => {
|
||||
const hash1 = await smarthash.sha265FromObject({
|
||||
'hithere': 1,
|
||||
'wow': 'two'
|
||||
hithere: 1,
|
||||
wow: 'two'
|
||||
});
|
||||
|
||||
const hash2 = await smarthash.sha265FromObject({
|
||||
'wow': 'two',
|
||||
'hithere': 1,
|
||||
wow: 'two',
|
||||
hithere: 1
|
||||
});
|
||||
|
||||
const hash3 = await smarthash.sha265FromObject({
|
||||
'wow': 'twoe',
|
||||
'hithere': 1,
|
||||
wow: 'twoe',
|
||||
hithere: 1
|
||||
});
|
||||
expect(hash1).to.equal(hash2);
|
||||
expect(hash1).to.not.equal(hash3);
|
||||
|
@ -1,5 +1,8 @@
|
||||
import * as plugins from './nodehash.plugins';
|
||||
|
||||
export const md5FromString = async (stringToHash: string) => {
|
||||
return plugins.crypto.createHash('md5').update(stringToHash).digest("hex");
|
||||
return plugins.crypto
|
||||
.createHash('md5')
|
||||
.update(stringToHash)
|
||||
.digest('hex');
|
||||
};
|
||||
|
@ -4,25 +4,15 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as stream from 'stream';
|
||||
|
||||
export {
|
||||
crypto,
|
||||
fs,
|
||||
path,
|
||||
stream
|
||||
};
|
||||
export { crypto, fs, path, stream };
|
||||
|
||||
// pushrocks scope
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartjson from '@pushrocks/smartjson';
|
||||
|
||||
export {
|
||||
smartpromise,
|
||||
smartjson
|
||||
};
|
||||
export { smartpromise, smartjson };
|
||||
|
||||
// thirdparty scope
|
||||
import through2 from 'through2';
|
||||
|
||||
export {
|
||||
through2
|
||||
};
|
||||
export { through2 };
|
||||
|
@ -35,7 +35,7 @@ export let sha256FromStringSync = (stringArg): string => {
|
||||
/**
|
||||
* Computes sha256 Hash from String
|
||||
*/
|
||||
export const sha256FromString = async(stringArg: string): Promise<string> => {
|
||||
export const sha256FromString = async (stringArg: string): Promise<string> => {
|
||||
const hash = plugins.crypto.createHash('sha256');
|
||||
hash.update(stringArg);
|
||||
const hashResult = hash.digest('hex');
|
||||
|
Reference in New Issue
Block a user