[FREE] Base conversions extension 🔃 Change numbers from one base into another, Base64, hex, binary, ascii and more

BaseToBase Extension :arrows_clockwise:

BaseToBaseAppLogo

Introduction

In the world of digital communication, the conversion of numbers between different formats is often a necessity. Because of the lack of these conversions in one place, the "BaseToBase" extension is here to simplify this process for you in Appinventor compatibles. This extension is designed to convert numbers from one base into another and vice versa. Whether you're working with hexadecimal, binary, integer, char codes, octal, ASCII (text), or Base64, this extension has you covered. Use it in any project, but keep the credits.

Technical info

Extension

  • Current version: V1.0.16 (Update to V15)
    Improvement how hex numbers are shown with odd digits. They get a leading zero.
    To the Codeberg git repository for download
  • Minimum Apilevel: 1
  • Permissions: No extra (Manifest.xml) permissions needed
  • Binary extension license: The 3-Clause BSD License (following at the end of this page)

Example

Functions

The "BaseToBase" extension offers a variety of functions to help you with number conversions.

AsciiToHex

asciitohex

  • Description: Convert Text (ASCII) to Hexadecimal.
  • Input: Text (e.g., "Hello!").
  • Output: Hexadecimal representation (e.g., "48656c6c6f21").

HexToAscii

hextoascii

  • Description: Convert Hexadecimal to Text (ASCII).
  • Input: Hexadecimal number (e.g., "48656c6c6f21").
  • Output: Text (e.g., "Hello!").

Base64ToHex

base64tohex

  • Description: Convert Base64 to Hexadecimal.
  • Input: Base64-encoded string (e.g., "SGVsbG8h").
  • Output: Hexadecimal representation (e.g., "48656c6c6f21").

HexToBase64

hextobase64

  • Description: Convert Hexadecimal to Base64.
  • Input: Hexadecimal number (e.g., "48656c6c6f21").
  • Output: Base64-encoded string (e.g., "SGVsbG8h").

BinaryToHex

binarytohex

  • Description: Convert Binary to Hexadecimal.
  • Input: Binary number (e.g., "010010000110010101101100011011000110111100100001").
  • Output: Hexadecimal representation (e.g., "48656c6c6f21").

HexToBinary

hextobinary

  • Description: Convert Hexadecimal to Binary.
  • Input: Hexadecimal number (e.g., "48656c6c6f21").
  • Output: Binary representation (e.g., "010010000110010101101100011011000110111100100001").

IntegerToHex

integertohex

  • Description: Convert Integer to Hexadecimal.
  • Input: Integer number (e.g., "79600447942433").
  • Output: Hexadecimal representation (e.g., "48656c6c6f21").

HexToInteger

hextointeger

  • Description: Convert Hexadecimal to Integer.
  • Input: Hexadecimal number (e.g., "48656c6c6f21").
  • Output: Integer number (e.g., "79600447942433").

OctalToHex

octaltohex

  • Description: Convert Octal to Hexadecimal.
  • Input: Octal number (e.g., "2206255433067441").
  • Output: Hexadecimal representation (e.g., "48656c6c6f21").

HexToOctal

hextooctal

  • Description: Convert Hexadecimal to Octal.
  • Input: Hexadecimal number (e.g., "48656c6c6f21").
  • Output: Octal representation (e.g., "2206255433067441").

Helper blocks

XtensionInfo

xtensioninfo

  • Description & Output: Extension version info & copyright.

XtensionUUID

xtensionuuid

  • Description & Output: Extension UUID

Example code block

Input: "Hello!"

Extension UUID

  • f9c820d0-4054-4e99-a0e8-68abba7e653a

FAQ - Frequently Asked Questions

  • Why do I need an input integer as string?
    Because the Biginteger library is used. Those big numbers do not fit in the standard java integer. On the other hand, you can use real big numbers. The limit is 32 * 2^32-1 bits for BigInteger or about 2^(4 billion). The output is also an integer as string.

Copyrights & License

  • :copyright:Eric M. Kok (appsbeheerder)
    For the (compiled Java source) BaseToBase extension the The 3-Clause BSD License is applicable.

    The 3-Clause BSD License
    BaseToBase, Copyright 2023 Eric M. Kok (appsbeheerder)

    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

2 Likes

Useful extension :star_struck::+1:

1 Like