-
Notifications
You must be signed in to change notification settings - Fork 1
Encode
nHash's encode command provides the ability to encode/decode various formats such as JWT, Base64, URL, and HTML.
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.
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
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==
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
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 <h1>nHash Encode Command</h1>