# dcryptjs

> A package for encrypt password.

Latest version **1.0.5** (published 2021-08-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install dcryptjs
pnpm add dcryptjs
yarn add dcryptjs
bun add dcryptjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-08-10 |
| First published | 2021-08-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | DK SHAKYA |
| Maintainers | dkshakya |

## Links

- npm: https://www.npmjs.com/package/dcryptjs
- npm.io page: https://npm.io/package/dcryptjs

## Recent versions

- 1.0.5 (latest) — 2021-08-10
- 1.0.4 — 2021-08-10
- 1.0.3 — 2021-08-10
- 1.0.2 — 2021-08-10
- 1.0.1 — 2021-08-10
- 1.0.0 — 2021-08-09

## README

dcrypt.js
=========
The library is compatible with CommonJS and AMD loaders and is exposed globally as dcodeIO.dcrypt if neither is available.

### node.js

On node.js, the inbuilt crypto module's randomBytes interface is used to obtain secure random numbers.

`npm install dcryptjs`

```js
var dcrypt = require('dcryptjs');
...
```
### Browser

In the browser, dcrypt.js relies on Web Crypto API's getRandomValues interface to obtain secure random numbers. If no cryptographically secure source of randomness is available, you may specify one through dcrypt.setRandomFallback.

Usage
-----

To hash a password:

```javascript
var dcrypt = require('dcryptjs');
var hashPassword = dcrypt.hash("Abc@123");  
// Store hashPassword in your password DB.
```
To check a password:

```javascript
// Load hashPassword from your password DB.
dcrypt.compare("Abc@123", hashPassword); // true
dcrypt.compare("not_bacon", hashPassword); // false
```
Note: Under the hood, asynchronisation splits a crypto operation into small chunks. After the completion of a chunk, the execution of the next chunk is placed on the back of JS event loop queue, thus efficiently sharing the computational resources with the other operations in the queue.

---
_Source: https://npm.io/package/dcryptjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
