"Sputnik" help  
Sputnik Help
BinaryEncode25(<binary>,[<compress>])

Description

Encodes a binary string into a base-25 representation using only uppercase letters (A-Z).

Parameters

<binary> The binary string to encode.
[<compress>] Optional specifies whether to compress the encoded binary string. (Default: false)

Return Value

Success: Returns the encoded base-25 representation of the binary string.
Failure: Returns an empty string.

Remarks

The BinaryEncode25 function converts a binary string into a base-25 representation using uppercase letters A-Z. It provides a safe method of storing data where only letters from the English alphabet are used, eliminating the possibility of special characters or symbols.

By default, the encoded base-25 string is not compressed. However, you can enable compression by setting the optional <compress> parameter to true. Compression reduces the size of the encoded string, but it may result in encoding some data into two characters instead of one.

Related

BinaryDecode25

Example

Example of usage:

my $binary = "Hello World";
my $encoded = BinaryEncode25($binary);
say $encoded;
my $decoded = BinaryDecode25($encoded);
say $decoded;
my $compressed = BinaryEncode25($binary, true);
say $compressed;
my $decompressed = BinaryDecode25($compressed, true);
say $decompressed;
// PRINTS
// CWEBEIEIELBHDMELEOEIEA
// Hello World
// BGFOAIAAAAAAAAAAAEAAJSCWIFIBIBDMAIIHBWICCXABAADLHCAXCYALAAAAAA
// Hello World

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org