SYNOPSIS

        use NetSDS::Util::Convert qw(...);

DESCRIPTION

\*(C`NetSDS::Util::Convert\*(C' module contains miscelaneous functions.

  • \s-1CLI\s0 parameters processing

  • types validation

  • \s-1HEX\s0, Base64, \s-1URI\s0, \s-1BCD\s0 encondig

  • \s-1UUID\s0 processing

EXPORTED FUNCTIONS

conv_conv_str_bcd($str) - convert string to little-endian \s-1BCD\s0

This function converts string to little-endian \s-1BCD\s0 encoding filled with F16 value.

conv_chr_hex($char) - encode char to hexadecimal string

$hex = conv_chr_hex('a'); # return 61

conv_hex_chr($hex) - convert hexadecimal string to character

$chr = conv_hex_chr('4A'); # return 'J'

conv_str_hex($str) - convert byte string to hexadecimal

$str = 'Want hex dump!'; $hex = conv_hex_str($str); print "Hex string: " . $hex;

conv_hex_str($string) - convert hex to byte string

$hex = '7A686F7061'; $string = conv_hex_str($hex); print "String from hex: " . $string;

conv_str_base64($str) - convert string to Base64

my $b64 = str_base64("Hallo, people!");

conv_base64_str($b64) - convert Base64 to string

my $str = base64_str($base64_string);

conv_str_uri($str) - convert string to \s-1URI\s0 encoded

Example: my $uri = str_uri("http://www.google.com/?q=what");

conv_uri_str($uri) - decode \s-1URI\s0 encoded string

Example: my $str = uri_str($uri_string);

EXAMPLES

None

BUGS

None

TODO

1. Add other encodings support

RELATED TO NetSDS::Util::Convert…

Pod::Usage, Data::UUID

AUTHORS

Valentyn Solomko <[email protected]>

Michael Bochkaryov <[email protected]>