Изменения от Главреда ГитЖС | Changes of GitJS Glavred
This commit is contained in:
15
функции|functions.js
Normal file
15
функции|functions.js
Normal file
@@ -0,0 +1,15 @@
|
||||
//https://developer.mozilla.org/ru/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
|
||||
|
||||
base64ЗашифроватьСтроку = строка =>
|
||||
{
|
||||
var байты = new TextEncoder("utf-8").encode(str);
|
||||
return base64js.fromByteArray(байты);
|
||||
};
|
||||
base64EncodeString = base64ЗашифроватьСтроку;
|
||||
|
||||
base64РасшифроватьСтроку = строка =>
|
||||
{
|
||||
var байты = base64js.toByteArray(строка);
|
||||
return new TextDecoder("utf-8").decode(байты);
|
||||
};
|
||||
base64DecodeString = base64РасшифроватьСтроку;
|
||||
Reference in New Issue
Block a user