linurdev

ASCII Converter

Jul 23rd, 2024
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Winbatch 0.55 KB | Software | 0 0
  1. @echo off
  2. echo Select an option:
  3. echo 1. Text to Hex
  4. echo 2. Hex to Text
  5. set /p choice=Enter your choice:
  6.  
  7. if "%choice%"=="1" (
  8.     set /p text=Enter the text:
  9.     node -e "const text = process.argv[1]; const hexString = Buffer.from(text, 'utf8').toString('hex'); console.log(hexString);" "%text%"
  10. ) else if "%choice%"=="2" (
  11.     set /p hexString=Enter the hex string:
  12.     node -e "const hexString = process.argv[1]; const text = Buffer.from(hexString, 'hex').toString('utf8'); console.log(text);" "%hexString%"
  13. ) else (
  14.     echo Invalid choice.
  15. )
Advertisement
Add Comment
Please, Sign In to add comment