From 2e138774ed7d13e9484bb950973911165a067626 Mon Sep 17 00:00:00 2001 From: devaskim Date: Fri, 10 Feb 2023 12:43:54 +0500 Subject: [PATCH] Add Base64 functions to Utils service. --- ui-ngx/src/app/core/services/utils.service.ts | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/core/services/utils.service.ts b/ui-ngx/src/app/core/services/utils.service.ts index 4de0bbf4c3..ee075f1db3 100644 --- a/ui-ngx/src/app/core/services/utils.service.ts +++ b/ui-ngx/src/app/core/services/utils.service.ts @@ -29,7 +29,11 @@ import { isDefined, isDefinedAndNotNull, isString, - isUndefined + isUndefined, + objToBase64, + objToBase64URI, + base64toString, + base64toObj } from '@core/utils'; import { WindowMessage } from '@shared/models/window-message.model'; import { TranslateService } from '@ngx-translate/core'; @@ -511,4 +515,21 @@ export class UtilsService { refCount() ); } + + public objToBase64(obj: any): string { + return objToBase64(obj); + } + + public base64toString(b64Encoded: string): string { + return base64toString(b64Encoded); + } + + public objToBase64URI(obj: any): string { + return objToBase64URI(obj); + } + + public base64toObj(b64Encoded: string): any { + return base64toObj(b64Encoded); + } + }