detect-high-entropy-strings

1.0.4 • Public • Published


npm version

D H E S

A module for detecting high entropy strings



Q: What is a high entropy string?

A high entropy string is a string that is close to random noise, with little to no structure. API keys, passwords, and hashed data are often high entropy strings.

Q: Why is this useful?

By being able to detect high entropy strings, you can automatically flag them, or redact them, preventing secrets from being leaked, for example by being committed to a public repository or logged to a file or service.

Installation

npm i detect-high-entropy-strings

Usage

const DHES = require('detect-high-entropy-strings')

const detector = new DHES()

const result = detector.isHighEntropyString("051cd83bef009e738bddbdbaac373d20");

if (result) {
  console.log("This is a high entropy string!")
} else {
  console.log("This is not a high entropy string.")
}

License

The project is licensed under the MIT license.

The icon at the top of this file is provided by pngrepo.com and is licensed under CC0.

Readme

Keywords

none

Package Sidebar

Install

npm i detect-high-entropy-strings

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

48.2 kB

Total Files

14

Last publish

Collaborators

  • sarjuhansaliya