Skip to content

Instantly share code, notes, and snippets.

@mesquka
Last active April 1, 2021 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mesquka/e240b6d12a6216f76e1cfe3ff7145d5a to your computer and use it in GitHub Desktop.
Save mesquka/e240b6d12a6216f76e1cfe3ff7145d5a to your computer and use it in GitHub Desktop.
Reads file and prints as hex string in a single line of JS (NodeJS)
console.log(require('fs').readFileSync(process.argv[2]).toString('hex'));
@mesquka
Copy link
Author

mesquka commented Apr 1, 2021

Usage:

node ReadFileToHex.js File_To_Read

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