https://github.com/guidanoli/base64-to-hex-converter
Base64 to Hexadecimal Converter
https://github.com/guidanoli/base64-to-hex-converter
Last synced: 7 months ago
JSON representation
Base64 to Hexadecimal Converter
- Host: GitHub
- URL: https://github.com/guidanoli/base64-to-hex-converter
- Owner: guidanoli
- License: gpl-3.0
- Created: 2022-07-12T12:29:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-26T01:35:27.000Z (about 2 years ago)
- Last Synced: 2025-02-19T07:02:47.135Z (8 months ago)
- Language: Python
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Base64 to Hexadecimal Converter
Converts strings in Base64 to Hexadecimal inside JSON files.
## Example
Consider the following JSON file called `data.json`.
```json
{
"mostRecentMachineHash": {
"data": "BAAAhWHqhD6t35WDLbQjCNThk04glwBqEGfmh27rkoA="
},
"mostRecentVouchersEpochRootHash": {
"data": "XhaRbdkr3XQD9FDIl/N8MDNG7z9LrT8YmigcNvqWnMY="
},
"mostRecentNoticesEpochRootHash": {
"data": "WJfJG6VyF4ndZkW5Z8/UGfd8ALPov88EcFpOyu1wZ9Q="
},
"processedInputs": [
{
"mostRecentMachineHash": {
"data": "VT/WlH6kqOvLt7/e3gOrAQriU7Lgq8QtZD0yh4jeAjc="
},
"voucherHashesInEpoch": {
"targetHash": {
"data": "S0oviQGm0hoFsu01ead/1odUJQO8b09Q5ZGBa6E0wEM="
},
"rootHash": {
"data": "XhaRbdkr3XQD9FDIl/N8MDNG7z9LrT8YmigcNvqWnMY="
}
},
"reports": [
{
"payload": "jcIadw=="
}
]
}
]
}
```If we run `python -m b64to16 data.json`, we get the following output.
```json
{
"mostRecentMachineHash": {
"data": "0x0400008561ea843eaddf95832db42308d4e1934e2097006a1067e6876eeb9280"
},
"mostRecentVouchersEpochRootHash": {
"data": "0x5e16916dd92bdd7403f450c897f37c303346ef3f4bad3f189a281c36fa969cc6"
},
"mostRecentNoticesEpochRootHash": {
"data": "0x5897c91ba5721789dd6645b967cfd419f77c00b3e8bfcf04705a4ecaed7067d4"
},
"processedInputs": [
{
"mostRecentMachineHash": {
"data": "0x553fd6947ea4a8ebcbb7bfdede03ab010ae253b2e0abc42d643d328788de0237"
},
"voucherHashesInEpoch": {
"targetHash": {
"data": "0x4b4a2f8901a6d21a05b2ed3579a77fd687542503bc6f4f50e591816ba134c043"
},
"rootHash": {
"data": "0x5e16916dd92bdd7403f450c897f37c303346ef3f4bad3f189a281c36fa969cc6"
}
},
"reports": [
{
"payload": "0x8dc21a77"
}
]
}
]
}
```We can also stream the JSON input through standard input, like `cat data.json | python -m b64to16`.
## Help
Run `python -m b64to16 -h`