started work on a custom method

This commit is contained in:
Boof 2023-08-24 13:04:16 +02:00 committed by GitHub
parent 4f25adfcd2
commit 517263bf86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

11
custom1.js Normal file
View File

@ -0,0 +1,11 @@
function stringToCustom1(str) {
return str.split('').map(function (char) {
return char.charCodeAt(0).toString(2);
}).join('-');
}
function custom1ToString(data) {
return data.split('-').map(function (bin) {
return String.fromCharCode(parseInt(bin, 2));
}).join('');
}

View File

@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bitlong</title>
<script src="custom1.js"></script>
<script src="binary.js" defer></script>
<script src="index.js" defer></script>
<script src="create.js" defer></script>