Number To String

Potency Low
Resilience Low
Cost Low
Tags: numbers, strings, obfuscation

Description

Number to String replaces the literal numbers (decimals, hexadecimals, octals, exponent notation) with a string representation that returns the same number value at run-time.

Code Annotation Example

// @jscrambler enable numberToString

Example

The following example contains a literal (integer) number:

user.phoneNumber = 555666777;

The result is an expression that returns the same number value using type coercion. The transformation produces random results so the following example is just a possible output:

user.phoneNumber = '555666777'-+[];

Using this transformation creates more targets for string obfuscation transformations.

Option Types

Name Required Default Value Description
freq No 0.8 Probability of applying the transformation when the node allows for the transformation to happen.
min No N/A Minimum number of times the transformation is applied on the node.
max No -1 Maximum number of times the transformation is applied on the node.

API Parameters

Example:

{
  "keys": {
    "accessKey": "XXXXXX",
    "secretKey": "YYYYYY"
  },
  "applicationId": "ZZZZZZ",
  "params": [
    {
      "name": "numberToString",
      "options": {}
    }
  ]
}