Why does k8s secrets need to be base64 encoded when configmaps does not?

Secrets can contain binary data (the type is map[string][]byte), and byte arrays are base64-encoded in JSON serialization. ConfigMaps only contain string data (the type is map[string]string), so the JSON serialization just outputs the string. In 1.10, ConfigMaps have a new binaryData field that allows storing binary data, which is base64-encoded, just like secrets. https://github.com/kubernetes/kubernetes/pull/57938

How to save a base64 image to user’s disk using JavaScript?

HTML5 download attribute Just to allow user to download the image or other file you may use the HTML5 download attribute. Static file download <a href=”/images/image-name.jpg” download> <!– OR –> <a href=”/images/image-name.jpg” download=”new-image-name.jpg”> Dynamic file download In cases requesting image dynamically it is possible to emulate such download. If your image is already loaded and … Read more

How to Base64 encoding on the iPhone

You can see an example here. This is for iOS7+. I copy the code here, just in case: // Create NSData object NSData *nsdata = [@”iOS Developer Tips encoded in Base64″ dataUsingEncoding:NSUTF8StringEncoding]; // Get NSString from NSData object in Base64 NSString *base64Encoded = [nsdata base64EncodedStringWithOptions:0]; // Print the Base64 encoded string NSLog(@”Encoded: %@”, base64Encoded); // … Read more

Decode base64 string and write to file

I do not know how you manage to do this, but the line endings \r\n in your string seem to be there as 4-byte character sequences, not as 2-byte escaped CRLF. If I copy your file into a ruby string with single ticks: unescaped=’PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48cmV2aWV3LWNhc2UgY3JlYXRl\r\nZGF0ZT0iMTMvTWFyLzIwMTQgMDk6MDQ6NTEiIHN5c3RlbT0iVHJhZmlndXJhX1RlbXBsYXRlX01h\r\nbmFnZW1lbnRfdjUuMSIgYmF0Y2hpZD0iMCIgdHJhbnNhY3Rpb25ubz0iMSIgYmF0Y2huYW1lPSJH’ Base64.decode64(unescaped) #=> garbled text for every second line if I do … Read more

OutOfMemoryError while decoding and encoding Base64 String into Bitmap

When showing Bitmap in ImageView from a file first decode it with the help of BitmapHelper.decodeFile(picturePath, 200, 200, true) this will return compressed Bitmap so that while encoding this Bitmap you can handle high resolution images as well as heavy size images upto 100 MB of file. After decoding file set it to your ImageView … Read more

how to display base64 encoded pdf?

for those who still can’t do it, i found this in someone else answer, but i don’t remember who… var objbuilder=””; objbuilder += (‘<object width=”100%” height=”100%” data=”data:application/pdf;base64,’); objbuilder += (myBase64string); objbuilder += (‘” type=”application/pdf” class=”internal”>’); objbuilder += (‘<embed src=”data:application/pdf;base64,’); objbuilder += (myBase64string); objbuilder += (‘” type=”application/pdf” />’); objbuilder += (‘</object>’); var win = window.open(“#”,”_blank”); var … Read more

Convert byte[] to Base64 string for data URI

I used this and it worked fine (contrary to the accepted answer, which uses a format not recommended for this scenario): StringBuilder sb = new StringBuilder(); sb.append(“data:image/png;base64,”); sb.append(StringUtils.newStringUtf8(Base64.encodeBase64(imageByteArray, false))); contourChart = sb.toString();

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)