A versatile tool for converting data between various base encodings, including Base64, Base32, Base58, and more. Available as a command-line tool and a web application, it empowers users to quickly encode, decode, or convert data seamlessly.
Note
The main functionality of this tool is now stable and fully operational. However, it is still in active development, and additional features and updates may be added in the future. Please expect occasional changes as development continues.
- π Seamless Conversion: Convert between numeral systems and base encodings (e.g., Base64 to Base32, Base58 to Base64).
- π€ String Encoding: Effortlessly transform strings into base encodings (e.g., text to Base64).
- 𧩠Decoding Made Easy: Decode base encodings back into readable text (e.g., Base64 to plain text).
- β‘ Intuitive Interface: Simple and user-friendly command-line prompts for quick and hassle-free usage.
- π High Performance: Lightweight, fast, and optimized for efficiency.
- π Versatile Utility: Perfect for data transformations, encoding workflows, and cryptographic tasks.
- πΎ Persistent History: The conversion history is saved in a JSON file, allowing you to revisit past conversions at any time.
To install this package, follow these steps:
-
Clone the repository:
First, clone the repository to your local machine to create a copy of it:git clone https://github.com/anonymByte-404/base-string-converter.git
-
Navigate to the project directory:
After cloning, move into the project directory where all the files are located:cd base-string-converter
-
Install dependencies using
npm
:
Install the required dependencies for the project by running:npm install
This will install all the necessary libraries and packages specified in the
package.json
file. -
Run the application:
Once the dependencies are installed, start the application using the following command:npm start
This will launch the application, and you should be able to use it as intended.
-
Select the type of conversion:
Choose the type of conversion you want to perform (e.g., String, Base). -
Choose the target base:
Select the target numeral system for your conversion (e.g., Base64, Base32, etc.). -
Input the string to convert:
Provide the string or data you wish to convert into the selected base or encoding. -
View the conversion output:
Check the conversion result and decide whether to proceed with further actions, such as repeating the conversion or returning to the main menu.
Below is an illustrative example of how you could use this tool programmatically in a Node.js application:
import inquirer from 'inquirer'
const baseChoices: string[] = Array.from(
{ length: 64 },
(_, i) => `Base ${i + 1}`
)
const main = (): void => {
inquirer
.prompt([
{
type: 'list',
name: 'conversionType',
message: 'Select the type of conversion you want to perform:',
choices: ['String Conversion', 'Base Conversion'],
},
])
.then((answers: { conversionType: string }) => {
if (answers.conversionType === 'String Conversion') {
return stringConverter(inquirer, main, baseChoices)
} else {
inquirer
.prompt([
{
type: 'list',
name: 'selectedBase',
message: 'Choose the target base for conversion:',
choices: baseChoices,
},
])
.then((answers: { selectedBase: string }) => {
switch (answers.selectedBase) {
case 'Base 2':
return binaryConverter(inquirer, main)
default:
console.log(
`Conversions for ${answers.selectedBase} are currently not supported.`
)
}
})
.catch((error: unknown) => {
console.error('An error occurred during base selection:', error)
})
}
})
.catch((error: unknown) => {
console.error('An error occurred during the initial prompt:', error)
})
}
main()
Note
This is not the actual code, but an illustration designed to demonstrate how the CLI tool operates. It serves as an example to show the general behavior and flow of the tool, rather than the complete or exact implementation.
Contributions are welcome! Here's how you can help:
-
Fork the repository.
Go to the repository page on GitHub and click the"Fork"
button to create your own copy. -
Clone your Fork
After forking the repository,clone
it to your local machine:git clone https://github.com/anonymByte-404/base-string-converter.git
-
Create a new branch for your feature or bug fix:
Create a newbranch
so you can work on your changes without affecting the main branch:git checkout -b feature/your-feature-name
-
Make your changes and commit:
After making your changes,commit
them with a meaningful message:git commit -m "Add your commit message here"
-
Push to your fork:
Push to yourfork
:git push origin feature/your-feature-name
-
Open a pull request on the main repository.
Go to the original repository on GitHub (https://github.com/anonymByte-404/base-string-converter) and open apull request
with your changes.
This project is licensed under the AGPL-3.0 License. See the LICENSE file for more details.