This package is a security utilities library created to analyze ESTree Literal and JavaScript string primitive. This project was originally created to simplify and better test the functionalities required for the SAST Scanner JS-X-Ray.
- Detect Hexadecimal, Base64, Hexa and Unicode sequences.
- Detect patterns (prefix, suffix) on groups of identifiers.
- Detect suspicious string and return advanced metrics on it (char diversity etc).
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i @nodesecure/sec-literal
# or
$ yarn add @nodesecure/sec-literal
Detect if the given string is an Hexadecimal value
Detect if the given string is a safe Hexadecimal value. The goal of this method is to eliminate false-positive.
Hex.isSafe("1234"); // true
Hex.isSafe("abcdef"); // true
Detect if a given string is a svg path or not.
Get the number of unique chars in a given string
Analyze a given string an give it a suspicion score (higher than 1 or 2 mean that the string is highly suspect).
MIT