Sudoo-Password

Continuous Integration codecov npm version downloads

Password utils

Install

yarn add @sudoo/password
# Or
npm install @sudoo/password --save

Usage

Saltilize password with both start and end appending

Password -> SaltPasswordSalt

import { Saltilizer } from "@sudoo/password";

const saltilizer: Saltilizer = Saltilizer.create("<Salt>");
const combined: string = saltilizer.combine("<Password>"); // Salted
const hashed: string = saltilizer.encrypt("<Password>"); // Salted and Hashed

const verifyResult: boolean = saltilizer.verify(hashed, "<Password>"); // true

Saltilize password with start appending

Password -> SaltPassword

import { Saltilizer } from "@sudoo/password";

const saltilizer: Saltilizer = Saltilizer.createStartAppended("<Salt>");
const combined: string = saltilizer.combine("<Password>"); // Salted
const hashed: string = saltilizer.encrypt("<Password>"); // Salted and Hashed

const verifyResult: boolean = saltilizer.verify(hashed, "<Password>"); // true

Saltilize password with end appending

Password -> PasswordSalt

import { Saltilizer } from "@sudoo/password";

const saltilizer: Saltilizer = Saltilizer.createEndAppended("<Salt>");
const combined: string = saltilizer.combine("<Password>"); // Salted
const hashed: string = saltilizer.encrypt("<Password>"); // Salted and Hashed

const verifyResult: boolean = saltilizer.verify(hashed, "<Password>"); // true