Skip to content

Virgarg7/password-generator-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

password-generator-lite [PUBLISHED]

password-generator-lite is a lightweight JavaScript library for cryptographic hashing, extraction, and transformation of strings. It provides functions for concatenating strings, computing SHA256 hashes, extracting numbers and letters, combining alphanumeric passwords, calculating string hashes, and transforming strings by converting lowercase letters to uppercase, and replacing the first alphanumeric character with a random sign.

Installation

You can install password-generator-lite via npm:

npm install password-generator-lite

Usage

concatenateAndHash

  •   import { concatenateAndHash } from 'password-generator-lite';
      let textA = "text1"
      let textB = "text2"
      let textArr = [textA, textB]
      let output1 = concatenateAndHash(textA)
      let output2 = concatenateAndHash(textArr)

extractNumbers

  •   import { extractNumbers } from 'password-generator-lite';
    
      let numberOfCharacters = 8 //defult
      let textA = "text1"
      let textB = "text2"
      let textArr = [textA, textB]
    
      let output1 = extractNumbers(textA)
      let output2 = extractNumbers(textArr)
      let output1 = extractNumbers(textA, numberOfCharacters)
      let output2 = extractNumbers(textArr, numberOfCharacters)

extractLetters

  •   import { extractLetters } from 'password-generator-lite';
    
      let numberOfCharacters = 8 //defult
      let textA = "text1"
      let textB = "text2"
      let textArr = [textA, textB]
    
      let output1 = extractLetters(textA)
      let output2 = extractLetters(textArr)
      let output1 = extractLetters(textA, numberOfCharacters)
      let output2 = extractLetters(textArr, numberOfCharacters)

combineNumbersAndLetters

  •   import { combineNumbersAndLetters } from 'password-generator-lite';
    
      let numberOfCharacters = 8 //defult
      let textA = "text1"
      let textB = "text2"
      let textArr = [textA, textB]
    
      let output1 = combineNumbersAndLetters(textA)
      let output2 = combineNumbersAndLetters(textArr)
      let output1 = combineNumbersAndLetters(textA, numberOfCharacters)
      let output2 = combineNumbersAndLetters(textArr, numberOfCharacters)

transformToUpperCase

  •   import { transformToUpperCase } from 'password-generator-lite';
    
      let numberOfCharacters = 8 //defult
      let textA = "text1"
      let textB = "text2"
      let textArr = [textA, textB]
    
      let output1 = transformToUpperCase(textA)
      let output2 = transformToUpperCase(textArr)
      let output1 = transformToUpperCase(textA, numberOfCharacters)
      let output2 = transformToUpperCase(textArr, numberOfCharacters)

transformToSign

  •   import { transformToSign } from 'password-generator-lite';
    
      let numberOfCharacters = 8 //defult
      let textA = "text1"
      let textB = "text2"
      let textArr = [textA, textB]
    
      let output1 = transformToSign(textA)
      let output2 = transformToSign(textArr)
      let output1 = transformToSign(textA, numberOfCharacters)
      let output2 = transformToSign(textArr, numberOfCharacters)

api

concatenateAndHash(textArray)

Concatenates an array of strings and computes the SHA256 hash of the resulting string.

extractNumbers(hash, numberOfCharacters)

Extracts numeric characters from a hash and returns a specified number of characters.

extractLetters(hash, numberOfCharacters)

Extracts alphabetical characters from a hash and returns a specified number of characters.

combineNumbersAndLetters(hash, numberOfCharacters)

Combines numeric and alphabetical passwords extracted from a hash.

transformToUpperCase(hash, numberOfCharacters)

Transforms lowercase letters to uppercase randomly in a string.

transformToSign(hash, numberOfCharacters)

Transforms the first alphanumeric character in a string to a random sign.

License

This project is licensed under the ISC

Contributing

Contributions are welcome! Please see our Contributing Guidelines for more information.

Issues

If you discover any issues, please create an issue in our GitHub repository.

Credits

password-generator-lite is developed and maintained by Vir Garg.

Support

For any inquiries or support requests, please contact us at vir.garg.in@gmail.com.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published