Core Function BinaryUUEncode

From Sputnik Wiki
Jump to: navigation, search
BinaryUUEncode( <binary-array> )

Contents

Description

Encodes a binary variable using the uuencode algorithm

Parameters

binary-array

The binary variable to encode.

Return Value

Success: Returns true.

Failure: Returns false.

Remarks

Uuencode translates all strings (including binary's ones) into printable characters, making them safe for network transmissions.

Uuencoded data is about 35% larger than the original.

Example

// Convert a string to binary
my $bin = Pack("A*", "Hello world!");
// UUEncode it
BinaryUUEncode($bin);
// Print it
say BinaryExpand($bin);
// Blank line
say;
// UUDecode it
BinaryUUDecode($bin);
// Print it
say BinaryExpand($bin);
// Prints:
// 2C 32 26 35 4C 3B 26 5C 40 3D 56 5D 52 3B 26 30 ,2&5L;&\@=V]R;&0
// 41 0A 60 0A -- -- -- -- -- -- -- -- -- -- -- -- A.`.
// 
// 48 65 6C 6C 6F 20 77 6F 72 6C 64 21 -- -- -- -- Hello world!
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox