Warning: This document is for the development version of Bareos Documentation. The main version is bareos-23.

bareos.util.bareosbase64.BareosBase64

class bareos.util.bareosbase64.BareosBase64[source]

Bases: object

Bareos specific base64 implementation.

Initialize the Base 64 conversion routines.

Methods

base64_to_int

Convert a base 64 string to integer.

int_to_base64

Convert an integer to base 64.

string_to_base64

Convert a string to base64.

twos_comp

Compute the 2's compliment of int value val.

Attributes

base64_digits

base64_to_int(base64)[source]

Convert a base 64 string to integer.

Parameters:

base64 (str) – base 64 string.

Returns:

Integer value of the base64 string.

Return type:

int

int_to_base64(value)[source]

Convert an integer to base 64.

Parameters:

value (int) – integeer value.

Returns:

base 64 representation of value.

Return type:

str

string_to_base64(string, compatible=False)[source]

Convert a string to base64.

Parameters:
  • string (str) – string to be converted.

  • compatible (bool) – If True, generate Baculas broken version of base 64 strings.

Returns:

base 64 representation of the given string.

Return type:

bytearray

static twos_comp(val, bits)[source]

Compute the 2’s compliment of int value val.