New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@type-ddd/password

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@type-ddd/password

Library that provides TypeScript type definitions for handling Password in Domain-Driven Design contexts. It facilitates the validation and manipulation of passwords.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
171
decreased by-8.56%
Maintainers
0
Weekly downloads
 
Created
Source

@type-ddd/password

The @type-ddd/password module provides a class Password for handling password in TypeScript. It includes methods for validating password, encrypt and compare.

Installation

Install rich-domain, @type-ddd/password and bcrypt with your favorite package manager:


npm i rich-domain @type-ddd/password bcrypt

#OR 

yarn add rich-domain @type-ddd/password bcrypt

Usage


import { Password } from '@type-ddd/password';

// Initialize Password instance with a valid value
const password = Password.init('Y8237FNB@');

// OR

// Create Password instance from provided value
const result = Password.create('Y8237FNB@');

// Or create a strong password
const pass = Password.random();

Compare password

You may compare password with plain text to check if is equal


const password = Password.init('#$89ABC_v');

// check if password is encrypted
password.isEncrypted();
// false

const encrypted = password.encrypt();

// compare
encrypted.compare('#$89ABC_v');
// true

Keywords

FAQs

Package last updated on 18 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc