Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 1.61 KB

README.md

File metadata and controls

61 lines (43 loc) · 1.61 KB


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.