Skip to content

A versatile utility designed to handle conversions between various base encodings, including Base64, Base32, Base58, and more. Available as both a command-line tool and a web application, it allows users to seamlessly encode, decode, or transform data between different base formats with ease and efficiency.

License

Notifications You must be signed in to change notification settings

anonymByte-404/base-string-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

base-string-converter

AGPL-3.0 License CLI Tool Version Web Tool Version Express TypeScript Definitions TypeScript ESLint Plugin TypeScript ESLint Parser ESLint Version ESLint Config Prettier ESLint Plugin Prettier Prettier Version TS-Node Version TypeScript Version CRA Template Version React Version React DOM Version React Router DOM Version React Scripts Version Web Vitals Version

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.

Table of Contents


Features

  • πŸ”„ 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.

Installation

To install this package, follow these steps:

  1. 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
  2. Navigate to the project directory:
    After cloning, move into the project directory where all the files are located:

    cd base-string-converter
  3. 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.

  4. 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.

Usage

  1. Select the type of conversion:
    Choose the type of conversion you want to perform (e.g., String, Base).
    image1

  2. Choose the target base:
    Select the target numeral system for your conversion (e.g., Base64, Base32, etc.).
    image2

  3. Input the string to convert:
    Provide the string or data you wish to convert into the selected base or encoding.
    image3

  4. 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.
    image4

Code Example

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.

Contribution

Contributions are welcome! Here's how you can help:

  1. Fork the repository.
    Go to the repository page on GitHub and click the "Fork" button to create your own copy.

  2. Clone your Fork
    After forking the repository, clone it to your local machine:

    git clone https://github.com/anonymByte-404/base-string-converter.git
  3. Create a new branch for your feature or bug fix:
    Create a new branch so you can work on your changes without affecting the main branch:

    git checkout -b feature/your-feature-name
  4. Make your changes and commit:
    After making your changes, commit them with a meaningful message:

    git commit -m "Add your commit message here"
  5. Push to your fork:
    Push to your fork:

    git push origin feature/your-feature-name
  6. 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 a pull request with your changes.

LICENSE

This project is licensed under the AGPL-3.0 License. See the LICENSE file for more details.

About

A versatile utility designed to handle conversions between various base encodings, including Base64, Base32, Base58, and more. Available as both a command-line tool and a web application, it allows users to seamlessly encode, decode, or transform data between different base formats with ease and efficiency.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published