1.0.4 • Published 2 years ago

detect-high-entropy-strings v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm version

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.