diff --git a/app/lib/common.ts b/app/lib/common.ts index aecb52f0e30b113c2f1038a2fac2d68206e1a72a..8501d067a94403799229ec5f08cd397de5e7a705 100644 --- a/app/lib/common.ts +++ b/app/lib/common.ts @@ -11,12 +11,8 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. -import * as crypto from 'crypto' +import {sha256} from 'duniteroxyde' -export const hashf = function hashf(str:string) { - return crypto - .createHash("sha256") - .update(str) - .digest("hex") - .toUpperCase() +export const hashf = function hashf(str:string) { + return sha256(str) } diff --git a/package.json b/package.json index 21a186cad36fb691132a72e57319bf19e66e0f47..fcd1261dcbddcf8df5dba7aa4783bf2267ad8d16 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "cors": "2.8.2", "daemonize2": "0.4.2", "ddos": "0.1.16", - "duniteroxyde": "0.1.0", + "duniteroxyde": "0.2.0", "errorhandler": "1.5.0", "event-stream": "3.3.4", "express": "4.15.2", diff --git a/yarn.lock b/yarn.lock index bb70a6a16d9ec3925befd1a066b205e5a2d7abc3..e92dd7d2d13ee6d2755508becadbe540039f358b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1495,10 +1495,10 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" -duniteroxyde@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/duniteroxyde/-/duniteroxyde-0.1.0.tgz#acc06fb7ac6e269a5d8b25f09c5d48088a087917" - integrity sha512-EDfxKlVhJrUyuWd9gBNHC1wrQ6Zc6z5JYR1LQf4yhW6N/LNPzM3S0uI95gWeSyNqwSlIiLiIOMoRxJenozqH4g== +duniteroxyde@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/duniteroxyde/-/duniteroxyde-0.2.0.tgz#5f84de3f92e91c5c65406c710a36dd47d2bde4b0" + integrity sha512-jMOD74/ajxn8sOHaCUzQ1wgoKcLBTpHeCdMGolqJxRoA+22fQdoQFJvUbRBo/T50sjcHvF51TPofig1S0Gg+6w== dependencies: neon-cli "^0.4.0"