Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

firebase-scrypt

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firebase-scrypt

Nodejs implementation of Firebase's Scrypt modified version.

  • 1.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.1K
decreased by-32.19%
Maintainers
1
Weekly downloads
 
Created
Source

Node Firebase Scrypt

NodeJs implementation of Firebase's Scrypt modified version

Warning

This module work only with users exported with Firebase Tools CLI and the command auth:export. Others way to gets users (Admin SDK, etc.) will give you an incompatible hash.

Table of Contents

  • Install
  • Usage
  • Test

Install

To install, run :

npm i firebase-scrypt

Usage

Firebase parameters

Go to Firebase to get your hash parameters. To access these parameters, navigate to the 'Users' tab of the 'Authentication' section in the Firebase Console and select 'Password Hash Parameters' from the drop down in the upper-right hand corner of the users table.

Initialisation

import { FirebaseScrypt } from 'firebase-scrypt'

const firebaseParameter = {
  memCost: 1, // replace by your
  rounds: 1, // replace by your
  saltSeparator: 'your-separator', // replace by your 
  signerKey: 'your-key', // replace by your
}

const scrypt = new FirebaseScrypt(firebaseParameters)

Hash


[...]

const password = "test"
const salt = "salt"

scrypt.hash(password, salt)
  .then(hash => console.log(hash))

Verify


[...]

const password = "test"
const salt = "salt"
const hash = "PrZI5nfqjOEk"

scrypt.verify(password, salt, hash)
  .then(isValid => isValid ? console.log('Valid !') : console.log('Not valid !'))

Test

To test, run :

npm run test

Keywords

FAQs

Package last updated on 18 Feb 2020

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