tedscreaming-text-crypto

1.1.4 • Public • Published

Text Crypto Utils

This module provides utilities for text encryption and hashing.

Installation

You can install this module via npm: npm install text-crypto-utils

Usage

Hash Password

const { hashPassword } = require('text-crypto-utils');

const password = 'password123';
hashPassword(password)
  .then(hashedPassword => {
    console.log('Hashed Password:', hashedPassword);
  })
  .catch(error => {
    console.error('Error:', error.message);
  });

Compare Passwords

const { comparePasswords } = require('text-crypto-utils');

const password = 'password123';
const hashedPassword = '$2b$10$liZb04TTkSE1xu/Rq7WQ8eB5UeT6nVn..vO1oHq9PzkWDwBxD0B4u';

comparePasswords(password, hashedPassword)
  .then(match => {
    console.log('Passwords Match:', match);
  })
  .catch(error => {
    console.error('Error:', error.message);
  });

Generate Random Token

const { generateRandomToken } = require('text-crypto-utils');

const token = generateRandomToken(20);
console.log('Random Token:', token);

Readme

Keywords

none

Package Sidebar

Install

npm i tedscreaming-text-crypto

Weekly Downloads

0

Version

1.1.4

License

ISC

Unpacked Size

3.09 kB

Total Files

3

Last publish

Collaborators

  • besenlesubstacey