How to use Base64 class of com.github.kittinunf.fuel.util package

Best Fuel code snippet using com.github.kittinunf.fuel.util.Base64

OCREngineFreeOCR.kt

Source:OCREngineFreeOCR.kt Github

copy

Full Screen

...85 Log.d(TAG, "Modified \"total bytes\" $totalBytes, bh: $bitHeight, bw: $bitWidth")86 }87 return Bitmap.createScaledBitmap(bitmap, bitWidth.toInt(), bitHeight.toInt(), false)88 }89 private fun convertImageToBase64(path: File?): String90 {91 if( path != null)92 {93 val bytes = path.readBytes()94 val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.lastIndex)95 Log.d(TAG, "Image size ${bytes.size} \n " +96 "Image h: ${bitmap.height} Image w: ${bitmap.width}")97 val stream = ByteArrayOutputStream()98 val quality = this.calculateImageFactor(bytes.size)99 bitmap.compress(Bitmap.CompressFormat.JPEG, quality, stream)100 val bytes2 = stream.toByteArray()101 Log.d(TAG, "After resize image size ${bytes2.size} \n " +102 "Image h: ${bitmap.height} Image w: ${bitmap.width}")103 val base64 = Base64.getEncoder().encodeToString(bytes2)104 return base64105 }106 return "Image is null"107 }108 private fun calculateImageFactor(imageSize: Int): Int109 {110 val MAXSIZE = 1000000//1MB111 var percentDelta = 100.00112 if (imageSize > MAXSIZE){113 val sizeDelta = imageSize - MAXSIZE114 val scale = sizeDelta.toDouble()/ imageSize.toDouble()115 percentDelta = (1 - scale) * 100116 }117 return percentDelta.toInt()118 }119 override fun extractText(_bitmap: Bitmap): String120 {121 /* //This version is using File type to send over to OCR122 val response = Fuel.post(URL.toString(), listOf("apikey" to OCRAPIKEY,123 "filetype" to JPG,124 "language" to LANG,125 "detectOrientation" to true,126 "OCREngine" to "2",127 "file" to "/"+ getImageFileLocation().toString()))128 //.header(Headers.CONTENT_TYPE, "multipart/form-data")129 //.jsonBody(createJsonBody())130 .upload()131 .add{ FileDataPart(getImageFileLocation(),contentType = "application/octet-stream") }132 .responseJson()*/133 val image = this.convertImageToBase64(FileManager.getImageFileLocation())134 val imageURL = FileManager.getCloudImageURL().toString()135 Log.d(TAG, "Starting API request")136 FuelManager.instance.timeoutInMillisecond = 15000 //Default 10 sec137 FuelManager.instance.timeoutReadInMillisecond = 15000 //Default 10 sec138 val response = Fuel.post(URL.toString(), listOf("apikey" to OCRAPIKEY,139 //"filetype" to JPG,140 "language" to LANG,141 "detectOrientation" to true,142 "OCREngine" to "2",143 "scale" to true,144 // "URL Hardcoded:"//"url" to "https://firebasestorage.googleapis.com/v0/b/pictoevents-1a825.appspot.com/o/paymentsOrtho11-26.PNG?alt=media&token=20e7c49b-7346-4685-a8cb-0620f953c2f7"))145 // "URL with Image://"url" to imageURL))146 "base64Image" to "data:image/$JPG;base64,$image"))147 .responseJson()...

Full Screen

Full Screen

Request.kt

Source:Request.kt Github

copy

Full Screen

...4import com.github.kittinunf.fuel.core.deserializers.StringDeserializer5import com.github.kittinunf.fuel.core.requests.DownloadTaskRequest6import com.github.kittinunf.fuel.core.requests.TaskRequest7import com.github.kittinunf.fuel.core.requests.UploadTaskRequest8import com.github.kittinunf.fuel.util.Base649import com.github.kittinunf.result.Result10import java.io.ByteArrayOutputStream11import java.io.File12import java.io.OutputStream13import java.net.URL14import java.nio.charset.Charset15import java.util.concurrent.Callable16import java.util.concurrent.Executor17import java.util.concurrent.ExecutorService18import java.util.concurrent.Future19import javax.net.ssl.HostnameVerifier20import javax.net.ssl.SSLSocketFactory21class Request : Fuel.RequestConvertible {22 enum class Type {23 REQUEST,24 DOWNLOAD,25 UPLOAD26 }27 var timeoutInMillisecond = 1500028 var timeoutReadInMillisecond = timeoutInMillisecond29 var type: Type = Type.REQUEST30 lateinit var httpMethod: Method31 lateinit var path: String32 lateinit var url: URL33 //body34 var bodyCallback: ((Request, OutputStream?, Long) -> Long)? = null35 val httpBody: ByteArray36 get() {37 return ByteArrayOutputStream().apply {38 bodyCallback?.invoke(request, this, 0)39 }.toByteArray()40 }41 lateinit var client: Client42 //headers43 val httpHeaders = mutableMapOf<String, String>()44 //params45 var parameters = listOf<Pair<String, Any?>>()46 var name = ""47 val names = mutableListOf<String>()48 val mediaTypes = mutableListOf<String>()49 //underlying task request50 val taskRequest: TaskRequest by lazy {51 when (type) {52 Type.DOWNLOAD -> DownloadTaskRequest(this)53 Type.UPLOAD -> UploadTaskRequest(this)54 else -> TaskRequest(this)55 }56 }57 var taskFuture: Future<*>? = null58 //configuration59 var socketFactory: SSLSocketFactory? = null60 var hostnameVerifier: HostnameVerifier? = null61 //callers62 lateinit var executor: ExecutorService63 lateinit var callbackExecutor: Executor64 //interceptor65 var requestInterceptor: ((Request) -> Request)? = null66 var responseInterceptor: ((Request, Response) -> Response)? = null67 //interfaces68 fun timeout(timeout: Int): Request {69 timeoutInMillisecond = timeout70 return this71 }72 fun timeoutRead(timeout: Int): Request {73 timeoutReadInMillisecond = timeout74 return this75 }76 fun header(vararg pairs: Pair<String, Any>?): Request {77 pairs.forEach {78 if (it != null)79 httpHeaders.plusAssign(Pair(it.first, it.second.toString()))80 }81 return this82 }83 fun header(pairs: Map<String, Any>?): Request = header(pairs, true)84 internal fun header(pairs: Map<String, Any>?, replace: Boolean): Request {85 pairs?.forEach {86 it.let {87 if (!httpHeaders.containsKey(it.key) || replace) {88 httpHeaders.plusAssign(Pair(it.key, it.value.toString()))89 }90 }91 }92 return this93 }94 fun body(body: ByteArray): Request {95 bodyCallback = { request, outputStream, totalLength ->96 outputStream?.write(body)97 body.size.toLong()98 }99 return this100 }101 fun body(body: String, charset: Charset = Charsets.UTF_8): Request = body(body.toByteArray(charset))102 fun authenticate(username: String, password: String): Request {103 val auth = "$username:$password"104 val encodedAuth = Base64.encode(auth.toByteArray(), Base64.NO_WRAP)105 return header("Authorization" to "Basic " + String(encodedAuth))106 }107 fun progress(handler: (readBytes: Long, totalBytes: Long) -> Unit): Request {108 if (taskRequest as? DownloadTaskRequest != null) {109 val download = taskRequest as DownloadTaskRequest110 download.apply {111 progressCallback = handler112 }113 } else if (taskRequest as? UploadTaskRequest != null) {114 val upload = taskRequest as UploadTaskRequest115 upload.apply {116 progressCallback = handler117 }118 } else {...

Full Screen

Full Screen

MojangKt.kt

Source:MojangKt.kt Github

copy

Full Screen

...8import com.github.kittinunf.fuel.httpPut9import com.github.kittinunf.result.Result10import com.google.gson.Gson11import com.google.gson.JsonObject12import java.util.Base6413import java.util.UUID14import java.util.regex.Pattern15import kotlin.coroutines.resume16import kotlin.coroutines.resumeWithException17import kotlin.coroutines.suspendCoroutine18class MojangKt {19 private val gson = Gson()20 @Suppress("UNUSED")21 var token = ""22 set(value) {23 field = value24 if (value.isEmpty()) {25 FuelManager.instance.baseHeaders = emptyMap()26 return27 }28 FuelManager.instance.baseHeaders = mapOf(29 "Authorization" to "Bearer $value"30 )31 }32 suspend fun getPlayerFromName(name: String): PrimitivePlayer = suspendCoroutine { cont ->33 "https://api.mojang.com/users/profiles/minecraft/$name"34 .httpGet()35 .responseObject<PrimitivePlayer> { _, _, result ->36 when (result) {37 is Result.Failure -> {38 cont.resumeWithException(result.getException())39 }40 is Result.Success -> {41 cont.resume(result.value)42 }43 }44 }45 }46 suspend fun getPlayersFromNames(names: List<String>): List<PrimitivePlayer> = suspendCoroutine { cont ->47 "https://api.mojang.com/profiles/minecraft"48 .httpPost()49 .jsonBody(50 names, gson51 )52 .responseObject<List<PrimitivePlayer>> { _, _, result ->53 when (result) {54 is Result.Failure -> {55 cont.resumeWithException(result.getException())56 }57 is Result.Success -> {58 cont.resume(result.value)59 }60 }61 }62 }63 suspend fun getProfileFromUuid(uuid: String): Profile = suspendCoroutine { cont ->64 "https://sessionserver.mojang.com/session/minecraft/profile/$uuid"65 .httpGet()66 .responseString {_, _, result ->67 when (result) {68 is Result.Failure -> {69 cont.resumeWithException(result.getException())70 }71 is Result.Success -> {72 val obj = gson.fromJson(result.value, JsonObject::class.java)73 val encodedProperties = obj["properties"].asJsonArray[0].asJsonObject["value"].asString74 val id = obj["id"].asString75 val name = obj["name"].asString76 val legacy = obj.has("legacy")77 var skinUrl = ""78 var skinType = getSkinType(id)79 var capeUrl = ""80 if (encodedProperties != null) {81 val texturesObj = gson.fromJson(String(Base64.getDecoder()82 .decode(encodedProperties)), JsonObject::class.java)83 .getAsJsonObject("textures")84 val skinObj = texturesObj.getAsJsonObject("SKIN")85 val capeObj = texturesObj.getAsJsonObject("CAPE")86 if (skinObj != null) {87 skinUrl = skinObj["url"].asString88 skinType = if (skinObj.has("metadata")) SkinType.SLIM else SkinType.DEFAULT89 }90 if (capeObj != null) {91 capeUrl = capeObj["url"].asString92 }93 }94 cont.resume(Profile(PrimitivePlayer(id, name, legacy), Skin(skinUrl, skinType), capeUrl))95 }...

Full Screen

Full Screen

JiraClient.kt

Source:JiraClient.kt Github

copy

Full Screen

...17 private val logger = KotlinLogging.logger {}18 private val defaultFieldsList = listOf("summary", "description", "labels", "status", "assignee")19 init {20 val encodedCredential =21 Base64.getEncoder().encodeToString("$userName:${System.getenv("COTEJI_JIRA_API_TOKEN")}".toByteArray())22 FuelManager.instance.baseHeaders = mapOf(23 Pair("Authorization", "Basic $encodedCredential"),24 Pair("Accept", "application/json"),25 Pair("Content-Type", "application/json")26 )27 FuelManager.instance.basePath = hostUrl28 }29 override fun getIssue(key: String): Map<String, Any> {30 val (_, _, result) = "/rest/api/latest/issue/$key"31 .httpGet()32 .responseObject<HashMap<String, Any>>()33 when (result) {34 is Failure -> {35 logger.error { String(result.error.errorData) }...

Full Screen

Full Screen

ApiClientFuel.kt

Source:ApiClientFuel.kt Github

copy

Full Screen

1package com.iproov.androidapiclient.kotlinfuel2import android.content.Context3import android.graphics.Bitmap4import android.graphics.BitmapFactory5import android.util.Base646import com.github.kittinunf.fuel.core.*7import com.github.kittinunf.fuel.coroutines.awaitObjectResult8import com.github.kittinunf.fuel.json.jsonDeserializer9import com.github.kittinunf.result.Result10import org.json.JSONObject11import com.google.gson.Gson12import com.iproov.androidapiclient.AssuranceType13import com.iproov.androidapiclient.ClaimType14import com.iproov.androidapiclient.DemonstrationPurposesOnly15import com.iproov.androidapiclient.PhotoSource16import com.iproov.androidapiclient.merge17import java.io.ByteArrayInputStream18import java.io.ByteArrayOutputStream19import java.io.InputStream20/**21 * This code uses Coroutines and Fuel to demonstrate the iProov API.22 * It is ONLY intended to show how server code might work and we only use this in client code for demo convenience.23 *24 * Not for production!25 *26 * Note that in this example callbacks are used to support success and failure lambdas27 * It is equally possible to embrace coroutines further and return to linear code that instead returns or throws,28 * allowing blockingEnrolPhotoAndGetVerifyToken() to become linear code with a try catch instead of callback inside callback29 */30@DemonstrationPurposesOnly31class ApiClientFuel(32 context: Context, // do not make val, if we need to keep a context, keep "context.applicationContext"33 val baseUrl: String = "https://eu.rp.secure.iproov.me/api/v2/",34 val apiKey: String,35 val secret: String36) {37 // Transitory access to packageName38 private val appID = context.packageName39 private val fuelInstance: FuelManager = FuelManager()40 /**41 * Obtain a token, given a ClaimType and userID42 */43 @Throws(FuelError::class)44 suspend fun getToken(assuranceType: AssuranceType, type: ClaimType, userID: String, options: Map<String, Any>? = null): String =45 fuelInstance46 .post("${baseUrl.safelUrl}claim/${type.toString().toLowerCase()}/token")47 .header("Content-Type" to "application/json")48 .body(Gson().toJson(mapOf(49 "api_key" to apiKey,50 "secret" to secret,51 "resource" to appID,52 "client" to "android",53 "user_id" to userID,54 "assurance_type" to assuranceType.backendName55 ).merge(options)))56 .awaitObjectResult(jsonDeserializer())57 .let { response ->58 when (response) {59 is Result.Success -> return response.value.obj().getString("token")60 is Result.Failure -> throw (response.error)61 }62 }63 /**64 * Enrol with a Photo, given a token and a PhotoSource65 */66 @Throws(FuelError::class)67 suspend fun enrolPhoto(token: String, image: Bitmap, source: PhotoSource): String =68 fuelInstance69 .upload("${baseUrl.safelUrl}claim/enrol/image", Method.POST, listOf(70 "api_key" to apiKey,71 "secret" to secret,72 "rotation" to "0",73 "token" to token,74 "source" to source.code75 ))76 .add(BlobDataPart(image.jpegImageStream(), "image", filename = "image.jpeg", contentType="image/jpeg"))77 .header("Content-Type" to "multipart/form-data; boundary=-------kjqdgfljhsgdfljhgsdlfjhgasdf" )78 .awaitObjectResult(jsonDeserializer())79 .let { response ->80 when (response) {81 is Result.Success -> return response.value.obj().getString("token")82 is Result.Failure -> throw (response.error)83 }84 }85 /**86 * Validate given a token and userID87 */88 @Throws(FuelError::class)89 suspend fun validate(token: String, userID: String): ValidationResult =90 fuelInstance91 .post("${baseUrl.safelUrl}claim/verify/validate")92 .body(Gson().toJson(mapOf(93 "api_key" to apiKey,94 "secret" to secret,95 "user_id" to userID,96 "token" to token,97 "ip" to "127.0.0.1",98 "client" to "android"99 )))100 .awaitObjectResult(jsonDeserializer())101 .let { response ->102 when (response) {103 is Result.Success -> return response.value.obj().toValidationResult()104 is Result.Failure -> throw (response.error)105 }106 }107 /**108 * Invalidate given a token and reason109 */110 @Throws(FuelError::class)111 suspend fun invalidate(token: String, reason: String): InvalidationResult =112 fuelInstance113 .post("${baseUrl.safelUrl}claim/$token/invalidate")114 .body(Gson().toJson(mapOf(115// "api_key" to apiKey,116// "secret" to secret,117 "reason" to reason118 )))119 .awaitObjectResult(jsonDeserializer())120 .let { response ->121 when (response) {122 is Result.Success -> return response.value.obj().toInvalidationResult()123 is Result.Failure -> throw (response.error)124 }125 }126}127// Extensions ----128/**129 * Aggregate extension function to getToken and enrolPhoto in one call.130 * - Get enrol token for the user ID131 * - Enrol the photo against the enrolment token132 * - Get a verify token for the user ID133 */134@DemonstrationPurposesOnly135suspend fun ApiClientFuel.enrolPhotoAndGetVerifyToken(userID: String, image: Bitmap, assuranceType: AssuranceType, source: PhotoSource, options: Map<String, Any>? = null): String =136 getToken(assuranceType, ClaimType.ENROL, userID).let { token1 ->137 enrolPhoto(token1, image, source)138 getToken(assuranceType, ClaimType.VERIFY, userID, options)139 }140fun Bitmap.jpegImageStream(): InputStream =141 ByteArrayOutputStream().let { stream ->142 compress(Bitmap.CompressFormat.JPEG, 100, stream)143 ByteArrayInputStream(stream.toByteArray())144 }145/**146 * JSON to ValidationResult mapping147 */148fun JSONObject.toValidationResult(): ValidationResult =149 ValidationResult(150 this.getBoolean("passed"),151 this.getString("token"),152 this.getOrNullString("frame")?.base64DecodeBitmap(),153 this.optJSONObject("result")?.getOrNullString("reason")154 )155/**156 * JSON to InvalidationResult mapping157 */158fun JSONObject.toInvalidationResult(): InvalidationResult =159 InvalidationResult(160 this.getBoolean("claim_aborted"),161 this.getBoolean("user_informed")162 )163private inline val String.endingWithSlash: String164 get() = if (endsWith("/")) this else "$this/"165private inline val String.safelUrl: String166 get() = if (endingWithSlash.endsWith("api/v2/")) endingWithSlash else "${endingWithSlash}api/v2/"167/**168 * Base64 decode to Bitmap mapping169 */170fun String.base64DecodeBitmap(): Bitmap? =171 with(Base64.decode(this, Base64.DEFAULT)) {172 try {173 BitmapFactory.decodeByteArray(this, 0, this.size)174 } catch(ex: Exception) { null }175 }176/**177 * Helper JSON function178 */179fun JSONObject.getOrNullString(key: String): String? =180 if (!isNull(key) && has(key)) getString(key) else null...

Full Screen

Full Screen

Client.kt

Source:Client.kt Github

copy

Full Screen

...61 return result.get()62 }63 fun encryptIt(d: String): String {64 Security.addProvider(BouncyCastleProvider())65 val key = Base64.getEncoder().encodeToString(password.hashMe("SHA-256").toByteArray()).slice(0..31)66 val keyBytes: ByteArray = key.toByteArray(charset("UTF8"))67 val skey = SecretKeySpec(keyBytes, "AES")68 val input = d.toByteArray(charset("UTF8"))69 synchronized(Cipher::class.java) {70 val cipher = Cipher.getInstance("AES/ECB/PKCS7Padding")71 cipher.init(Cipher.ENCRYPT_MODE, skey)72 val cipherText = ByteArray(cipher.getOutputSize(input.size))73 var ctLength = cipher.update(74 input, 0, input.size,75 cipherText, 076 )77 ctLength += cipher.doFinal(cipherText, ctLength)78 return String(Base64.getEncoder().encode(cipherText))79 }80 }81 fun decryptIt(d: String): String {82 Security.addProvider(BouncyCastleProvider())83 val key = Base64.getEncoder().encodeToString(password.hashMe("SHA-256").toByteArray()).slice(0..31)84 val keyBytes = key.toByteArray(charset("UTF8"))85 val skey = SecretKeySpec(keyBytes, "AES")86 val input = org.bouncycastle.util.encoders.Base6487 .decode(d.trim { it <= ' ' }.toByteArray(charset("UTF8")))88 synchronized(Cipher::class.java) {89 val cipher = Cipher.getInstance("AES/ECB/PKCS7Padding")90 cipher.init(Cipher.DECRYPT_MODE, skey)91 val plainText = ByteArray(cipher.getOutputSize(input.size))92 var ptLength = cipher.update(input, 0, input.size, plainText, 0)93 ptLength += cipher.doFinal(plainText, ptLength)94 return String(plainText).trim { it <= ' ' }95 }96 }97}98fun String.hashMe(algo: String): String {99 val bytes = this.toByteArray()100 val md = MessageDigest.getInstance(algo)...

Full Screen

Full Screen

FuelGithubClient.kt

Source:FuelGithubClient.kt Github

copy

Full Screen

...15import org.danilopianini.upgradle.api.Token16import org.danilopianini.upgradle.api.UserAndPassword17import org.danilopianini.upgradle.remote.Repository18import java.io.Reader19import java.util.Base6420class FuelGithubClient(credentials: Credentials) : GithubGraphqlClient {21 private companion object {22 val classLoader: ClassLoader by lazy { this::class.java.classLoader }23 const val ENDPOINT = "https://api.github.com/graphql"24 }25 private val authorization = when (credentials) {26 is Token -> "Bearer ${credentials.token}"27 is UserAndPassword -> {28 val enc = Base64.getEncoder()29 .encodeToString("${credentials.user}:${credentials.password}".toByteArray())30 "Basic $enc"31 }32 }33 private suspend fun getRequestBody(resourceName: String, variables: Map<String, Any?>): Map<String, Any> =34 withContext(Dispatchers.IO) {35 val query = requireNotNull(classLoader.getResourceAsStream(resourceName))36 .bufferedReader()37 .use(Reader::readText)38 mapOf("query" to query, "variables" to variables)39 }40 private suspend inline fun <reified T : Any> requestOf(resourceName: String, variables: Map<String, Any?>): T =41 Fuel.post(ENDPOINT)42 .header("Content-Type", "application/json")...

Full Screen

Full Screen

RestTalker.kt

Source:RestTalker.kt Github

copy

Full Screen

...61 return json.stringify(Request.serializer(), request)62 }63 private fun encrypt(str: String): String {64 val encrypted = hybridEncrypt!!.encrypt(str.toByteArray(), null)65 return android.util.Base64.encodeToString(encrypted, android.util.Base64.DEFAULT)66 }67}...

Full Screen

Full Screen

Base64

Using AI Code Generation

copy

Full Screen

1val encodedString = Base64.encodeToString("Hello World".toByteArray(), Base64.NO_WRAP)2val decodedString = Base64.decode(encodedString, Base64.NO_WRAP)3val encodedString = android.util.Base64.encodeToString("Hello World".toByteArray(), Base64.NO_WRAP)4val decodedString = android.util.Base64.decode(encodedString, Base64.NO_WRAP)5val encodedString = java.util.Base64.getEncoder().encodeToString("Hello World".toByteArray())6val decodedString = String(java.util.Base64.getDecoder().decode(encodedString))7val byteArray = string.toByteArray()8val encodedString = Base64.encodeToString(byteArray, Base64.NO_WRAP)9The first parameter of encodeToString() method is the byte array that we want to encode. The second parameter is the flag that specifies how the encoded data is to be broken into

Full Screen

Full Screen

Base64

Using AI Code Generation

copy

Full Screen

1val (request, response, result) = Fuel.upload("/post").source { request, url ->2Base64.encode(request.toByteArray())3}4val (request, response, result) = Fuel.upload("/post").source { request, url ->5Base64.getEncoder().encode(request.toByteArray())6}

Full Screen

Full Screen

Base64

Using AI Code Generation

copy

Full Screen

1import com.github.kittinunf.fuel.util.Base642val base64 = Base64.encodeToString("hello".toByteArray(), Base64.DEFAULT)3val string = Base64.decodeToString(base64, Base64.DEFAULT)4val base64 = Base64.encodeToString("hello".toByteArray(), Base64.DEFAULT, Charset.forName(“UTF-8”))5val string = Base64.decodeToString(base64, Base64.DEFAULT, Charset.forName(“UTF-8”))6val base64 = Base64.encodeToString("hello".toByteArray(), Base64.DEFAULT, Charset.forName(“UTF-8”), Base64.NO_CLOSE)7val string = Base64.decodeToString(base64, Base64.DEFAULT, Charset.forName(“UTF-8”), Base64.NO_CLOSE)8val base64 = Base64.encodeToString("hello".toByteArray(), Base64.DEFAULT, Base64.NO_CLOSE)9val string = Base64.decodeToString(base64, Base64.DEFAULT, Base64.NO_CLOSE)10val base64 = Base64.encodeToString("hello".toByteArray(), Base64.DEFAULT, Base64.NO_CLOSE)11val string = Base64.decodeToString(base64, Base64.DEFAULT, Base64.NO_CLOSE)12val base64 = Base64.encodeToString("hello".toByteArray(), Base64.DEFAULT, Base64.NO_CLOSE)13val string = Base64.decodeToString(base64, Base64.DEFAULT, Base64.NO_CLOSE)14val base64 = Base64.encodeToString("hello".toByteArray(), Base64.DEFAULT, Base64.NO_CLOSE)15val string = Base64.decodeToString(base64, Base64.DEFAULT, Base64.NO_CLOSE)16val base64 = Base64.encodeToString("hello".toByteArray(), Base64.DEFAULT

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful