public static function encode(
    /*string*/ $string,
    /*boolean*/ $oneLine = true
  ) {
    if(!self::isEncoded($string)) {
      $string = base64_encode($string);
    }
    if($string && $oneLine) {
      $string = str_replace(["\r", "\n"], '', $string);
    }
    return $string;
  }