Skip to content
Naser edited this page Mar 26, 2023 · 2 revisions

nHash's encode command provides the ability to encode/decode various formats such as JWT, Base64, URL, and HTML.

Usage

To use the encode command, you can run nhash encode followed by the name of the subcommand and its required arguments. For example:

nhash encode jwt eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjozNTYyNzY0MDAwLCJleHAiOjE2NTQ5NjQwMDB9.7tI-fy5YksJ0m5Z5M5wNSzqvhfWg2JHzN43eXbEryvo

This will decode the given JWT token and output the result in the console.

Subcommands

jwt

The jwt subcommand provides the ability to decode a JWT token. The required argument for this subcommand is the JWT token itself.

nhash encode jwt eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjozNTYyNzY0MDAwLCJleHAiOjE2NTQ5NjQwMDB9.7tI-fy5YksJ0m5Z5M5wNSzqvhfWg2JHzN43eXbEryvo

base64

The base64 subcommand provides the ability to encode/decode a Base64 string. The required argument for this subcommand is the text to encode/decode.

To encode:

nhash encode base64 "Hello, World!"

To decode:

nhash encode base64 SGVsbG8sIFdvcmxkIQ==

url

The url subcommand provides the ability to encode/decode a URL string. The required argument for this subcommand is the text to encode/decode.

To encode:

nhash encode url "https://github.com"

To decode:

nhash encode url https%3A%2F%2Fgithub.com

html

The html subcommand provides the ability to encode/decode an HTML string. The required argument for this subcommand is the text to encode/decode.

To encode:

nhash encode html "<h1>nHash Encode Command</h1>"

To decode:

nhash encode html &lt;h1&gt;nHash Encode Command&lt;/h1&gt;
Clone this wiki locally