mirror of
https://github.com/hexahigh/bitlong.git
synced 2025-12-11 20:15:10 +01:00
started work on a custom method
This commit is contained in:
parent
4f25adfcd2
commit
517263bf86
11
custom1.js
Normal file
11
custom1.js
Normal 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('');
|
||||
}
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user