Ldap-sha
Ldap SSHA password generator for node
✨ Features
- Encrypt a plain text password with the Ldap SSHA algorithm.
- Verify passwords encrypted with SSHA.
- No external dependencies.
🚀 Setup
-
Install with your favorite package manager:
- pnpm :
pnpm i ldap-sha
- npm :
npm i ldap-sha
- yarn :
yarn add ldap-sha
- bun :
bun add ldap-sha
-
Import the function into your project:
import { ssha, verifySSHA } from 'ldap-sha'
⚡️ Usage
- Encrypt a plain text password using SSHA:
const encryptedPassword = ssha('mySuperSecretPassword')
- Validate your plain text password with a SSHA encrypted password:
The SSHA password can be either a single string or an array of strings. The plain text password will be compared to each SSHA password and the function will return true if any of them matches
const isValid = verifySSHA('mySuperSecretPassword', arrayOfSSHAPasswords)
📝 License
Copyright © 2024 Gabriel 'DethDKN' Rosa
This project is under MIT license