Тёмный

Javascript Tutorial 38: Base64 Encoding And Decoding 

Mehul - Codedamn
Подписаться 423 тыс.
Просмотров 49 тыс.
50% 1

This playlist has been updated! Please check: www.youtube.co... how to encode and decode strings in base64 javascript with atob() and btoa() function in javascript.Website: codedamn.com
Facebook: / codedammmn
Twitter: / codedammer

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 20   
@hereticstanlyhalo6916
@hereticstanlyhalo6916 6 лет назад
So, say when you type something into a box and u hit double spaces here's an example of wat the code looks like vs the thing u see "  hello" vs thing u see " hello", so I'm making it save the file, it works but it saves the   too, how do i make the javascript read the   as a space?
@RoushanKumar-lq1er
@RoushanKumar-lq1er 8 лет назад
hi i have a problem that i am making a chrome extension i which i have to copy a png image from a website and pass it to my native application. i am trying to get the png image in a variable. var captcha = document.getElementById("cimage").src; and when i type catcha then in output it gives me the image URL. now how can i convert that captcha variable into a base64 string.
@codedamn
@codedamn 8 лет назад
function toDataUrl(url, callback) { var xhr = new XMLHttpRequest(); xhr.responseType = 'blob'; xhr.onload = function() { var reader = new FileReader(); reader.onloadend = function() { callback(reader.result); } reader.readAsDataURL(xhr.response); }; xhr.open('GET', url); xhr.send(); } Use: var captcha = document.getElementById("cimage").src; toDataUrl(captcha, function(base64Img) { console.log(base64Img); }); Source: stackoverflow.com/questions/6150289/how-to-convert-image-into-base64-string-using-javascript
@pandu0287
@pandu0287 6 лет назад
how to decode in controller
@leavethematrix9939
@leavethematrix9939 8 лет назад
So would you do this to protect data from hackers? Like it is an inscription? Could they hacker just convert it back with btoa() themselves?
@codedamn
@codedamn 8 лет назад
I never said that it is used for encryption. Base64 is just a tool to convert a string to another string where only 64 valid and HTTP protocol safe characters are used. Its just like writing roman numerals in binary, anyone can do that. Understand the difference between encryption and encoding. Base64 is encoding, not encryption.
@jsonkody
@jsonkody 6 лет назад
Its like: presume that everybody knows english ok? If someone send mail he doesnt know if reciever speaks same language .. like russian send a mail to spain but for them its some gibberish. So russian translate it to english and send it to spain in english. They translate it back from english to spain, got it? Now you asked if translation your message to language everybody knows prevents someone from reading it .. try guess :)
@atAnkitMurarka
@atAnkitMurarka 6 лет назад
So A understands binary and B understands Base10. A wants to send data to B. A converts binary data to base64 and sends to B. B receives the data and converts the base64 data to base10 and hence understands the text. That correct?
@mizech
@mizech 7 лет назад
Well done. Thanks a lot.
Далее
Javascript Tutorial 39: Intro to regular expression
6:21
МАЛОЙ ГАИШНИК
00:35
Просмотров 225 тыс.
Learn JSON in 10 Minutes
12:00
Просмотров 3,2 млн
Deep Dive into Blobs, Files, and ArrayBuffers
17:42
Просмотров 36 тыс.
Base64 encoding/decoding in java 8
10:05
Просмотров 36 тыс.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
JavaScript Promises In 10 Minutes
11:31
Просмотров 1,7 млн
Array Methods in JavaScript | 17 Useful Methods
42:39
URL to File/Blob in JavaScript
10:14
Просмотров 54 тыс.
МАЛОЙ ГАИШНИК
00:35
Просмотров 225 тыс.