switch to crypto lib

c2eaae3d428ef7700ce15200a3fa734f756c8a6d

Karl-Johan Alm <karljohan-alm@garage.co.jp>

Signed
3 files changed, +2 -10Ignore whitespace
package-lock.json+0 -7
@@ -43,7 +43,6 @@
4343 "ip-matching": "^2.1.2",
4444 "ipaddr.js": "^2.0.1",
4545 "jimp": "^0.22.10",
46- "js-sha256": "^0.11.0",
4746 "localforage": "^1.10.0",
4847 "lodash": "^4.17.21",
4948 "mime-types": "^2.1.35",
@@ -4883,12 +4882,6 @@
48834882 "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==",
48844883 "license": "BSD-3-Clause"
48854884 },
4886- "node_modules/js-sha256": {
4887- "version": "0.11.0",
4888- "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.11.0.tgz",
4889- "integrity": "sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q==",
4890- "license": "MIT"
4891- },
48924885 "node_modules/js-yaml": {
48934886 "version": "4.1.0",
48944887 "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
package.json+0 -1
@@ -33,7 +33,6 @@
3333 "ip-matching": "^2.1.2",
3434 "ipaddr.js": "^2.0.1",
3535 "jimp": "^0.22.10",
36- "js-sha256": "^0.11.0",
3736 "localforage": "^1.10.0",
3837 "lodash": "^4.17.21",
3938 "mime-types": "^2.1.35",
src/endpoints/backends/text-completions.js+2 -2
@@ -16,7 +16,7 @@ import {
1616} from '../../constants.js';
1717import { forwardFetchResponse, trimV1, getConfigValue } from '../../util.js';
1818import { setAdditionalHeaders } from '../../additional-headers.js';
1919import { sha256createHash } from 'js-sha256crypto';
2020
2121export const router = express.Router();
2222
@@ -261,7 +261,7 @@ router.post('/chat_template', jsonParser, async function (request, response) {
261261
262262 /** @type {any} */
263263 const chatTemplate = await chatTemplateReply.json();
264264 chatTemplate['chat_template_hash'] = sha256.createcreateHash('sha256').update(chatTemplate['chat_template']).hexdigest('hex');
265265 return response.send(chatTemplate);
266266 } catch (error) {
267267 console.error(error);