GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add numbersToHexadecimal option to control number to hex conversion by jbetala7 · Pull Request #1319 · javascript-obfuscator/javascript-obfuscator

Conversation

@jbetala7

@jbetala7 jbetala7 commented Aug 7, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🎯 Purpose

Resolves #1317 - Adds option to prevent automatic conversion of numbers to hexadecimal format.

📋 Changes

  • ✅ Added numbersToHexadecimal boolean option (default: true)
  • ✅ Updated NumberLiteralTransformer to respect the new option
  • ✅ Added CLI support with --numbers-to-hexadecimal flag
  • ✅ Updated all configuration presets and interfaces
  • ✅ Added comprehensive test coverage
  • ✅ Updated README documentation with examples

🔄 Behavior

  • Default (true): Maintains existing behavior (backward compatible)
  • New (false): Keeps numbers in decimal format

🧪 Testing

Added test cases covering both scenarios:

  • ✅ numbersToHexadecimal: true converts to hex
  • ✅ numbersToHexadecimal: false preserves decimal

📚 Documentation

  • Updated README with option description and examples
  • Added CLI option documentation
  • Updated default options section

🔧 Usage Examples

// JavaScript API
JavaScriptObfuscator.obfuscate(code, {
    numbersToHexadecimal: false
});

// CLI
javascript-obfuscator input.js --numbers-to-hexadecimal false

This solution will help not just @acemtp, but any other users who prefer to keep their numbers in decimal format for readability or specific requirements!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sanex3339

sanex3339 commented Nov 29, 2025

Copy link
Copy Markdown
Member

Please remove package-lock.json and yarn.lock files from this PR, and i will merge it

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jbetala7

jbetala7 commented Nov 30, 2025

Copy link
Copy Markdown
Author

Both package-lock.json and yarn.lock files have been deleted

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jbetala7 jbetala7 changed the title feat: add numbersToHexadecimal option to control number to hex conver… feat: add numbersToHexadecimal option to control number to hex conversion Nov 30, 2025
@sanex3339

sanex3339 commented Dec 4, 2025

Copy link
Copy Markdown
Member

I still see yarn.lock conflict

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jbetala7
feat: add numbersToHexadecimal option to control number to hex conver…
90899b4
…sion

- Add new numbersToHexadecimal option (default: true) to control whether numbers are converted to hexadecimal format
- When true, numbers like 1000 are converted to 0x3e8
- When false, numbers remain in their original decimal format
- Update CLI interface to support --numbers-to-hexadecimal flag
- Add comprehensive documentation with examples
- Update all relevant presets and tests
- Fixes issue where users couldn't disable number to hex conversion
@jbetala7
jbetala7 force-pushed the opt-added-to-not-convert--numbers-to-hexadecimal branch from 7206b58 to 90899b4 Compare May 12, 2026 07:52
@jbetala7

jbetala7 commented May 12, 2026

Copy link
Copy Markdown
Author

Rebased on current master and removed the lockfile changes from the PR diff. The PR now only includes the feature/docs/test files; package-lock.json and yarn.lock are no longer modified.

Verification:

  • corepack yarn run test:mocha -- --grep numbersToHexadecimal
  • git diff --check upstream/master...HEAD
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

how to not convert numbers into hexadecimal?

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@jbetala7 @sanex3339
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.