https://github.com/kevinrodriguez-io/bs58-converter
https://github.com/kevinrodriguez-io/bs58-converter
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kevinrodriguez-io/bs58-converter
- Owner: kevinrodriguez-io
- Created: 2024-12-30T14:35:04.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-12-30T14:37:15.000Z (10 months ago)
- Last Synced: 2025-01-31T09:19:50.065Z (9 months ago)
- Language: Rust
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bs58-converter
A command-line tool that converts Base58 strings to byte arrays and saves them as JSON files.
I made this as a little helper to grab my id.json file from my Phantom Solana wallet.
## Features
- Convert Base58 strings to byte arrays
- Asynchronous file operations
- Progress indicators for each step
- Customizable output file path
## Installation
### From Source
1. Make sure you have Rust and Cargo installed. If not, install them from [rustup.rs](https://rustup.rs/)
2. Clone the repository and build:
```bash
git clone https://github.com/kevinrodriguez-io/bs58-converter.git
cd bs58-converter
cargo install --path .
```
This will install the `bs58-converter` binary in your system.
## Usage
Basic usage:
```bash
bs58-converter -i -o ~/.config/solana/id.json
```
This will create an `output.json` file in the current directory.
### Options
- `-i, --input`: The Base58 string to convert (required)
- `-f, --input-file`: Input file containing the Base58 string (optional)
- `-o, --output`: Output JSON file path (optional, defaults to "output.json")
- `-h, --help`: Show help information
- `-V, --version`: Show version information
### Examples
Convert a Base58 string to a JSON file:
```bash
bs58-converter --input "5Q6qHRLW2wntVBwRWFyqj5eXKFqHN6"
```
Specify a custom output file:
```bash
bs58-converter --input "5Q6qHRLW2wntVBwRWFyqj5eXKFqHN6" --output my-bytes.json
```
## Output Format
The tool generates a JSON file with the following structure:
```json
[1,2,3,...] // Array of decoded bytes
```