From f474f42fa3a62effc1009153b8810a68e7c167f5 Mon Sep 17 00:00:00 2001 From: cemal Date: Thu, 25 Jan 2024 16:28:20 +0100 Subject: [PATCH] First Commit --- index.js | 11 +++++++++++ package-lock.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ package.json | 22 ++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 index.js create mode 100644 package-lock.json create mode 100644 package.json diff --git a/index.js b/index.js new file mode 100644 index 0000000..c3c006a --- /dev/null +++ b/index.js @@ -0,0 +1,11 @@ +//NPM package that will have encrypt method with sha1 +const sha1 = require('sha1'); +function encryptSha1(password) { + return sha1(password); +} + +function compareSha1(password, hash) { + return sha1(password) === hash; +} + +module.exports = { encryptSha1, compareSha1 }; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6d9e264 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,44 @@ +{ + "name": "iut-encrypt", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "iut-encrypt", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "sha1": "^1.1.1" + } + }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "engines": { + "node": "*" + } + }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "engines": { + "node": "*" + } + }, + "node_modules/sha1": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", + "integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==", + "dependencies": { + "charenc": ">= 0.0.1", + "crypt": ">= 0.0.1" + }, + "engines": { + "node": "*" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..760f4b2 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "iut-encrypt-cemal", + "version": "1.0.0", + "description": "sha1 encrypter", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://git.odabasioglu.fr/Cemal/iut-encrypt" + }, + "keywords": [ + "sha1" + ], + "author": "Cemal", + "license": "ISC", + "dependencies": { + "sha1": "^1.1.1" + }, + "devDependencies": {} +}