---
name: "NetSDS::Util::Convert"
section: "3pm"
platform: "linux"
package: "libnetsds-util-perl"
version: "1.045-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/NetSDS::Util::Convert"
---

# NetSDS::Util::Convert(3pm)

data formats conversion functions

## NAME

NetSDS::Util::Convert - data formats conversion functions

## SYNOPSIS

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

## DESCRIPTION

`"NetSDS::Util::Convert"` module contains miscelaneous functions.

- •

  CLI parameters processing

- •

  types validation

- •

  HEX, Base64, URI, BCD encondig

- •

  UUID processing

## EXPORTED FUNCTIONS

- **conv\_conv\_str\_bcd($str)** - convert string to little-endian BCD

  This function converts string to little-endian BCD 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 URI encoded

  Example:

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

- **conv\_uri\_str($uri)** - decode URI encoded string

  Example:

  ```
          my $str = uri_str($uri_string);
  ```

## EXAMPLES

None

## BUGS

None

## TODO

1\. Add other encodings support

## SEE ALSO

Pod::Usage, Data::UUID

## AUTHORS

Valentyn Solomko \<pere@pere.org.ua\>

Michael Bochkaryov \<misha@rattler.kiev.ua\>
