Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jajbshjahavahh
GitHub Repository: jajbshjahavahh/Gojo-Satoru
Path: blob/master/lib/binary.js
2591 views
1
//═══════════════════════════════════════════════════════//
2
//If you want to recode, reupload
3
//or copy the codes/script,
4
//pls give credit
5
//no credit? i will take action immediately
6
//© 2022 Xeon Bot Inc. Cheems Bot MD
7
//Thank you to Lord Buddha, Family and Myself
8
//════════════════════════════//
9
async function dBinary(str) {
10
var newBin = str.split(" ")
11
var binCode = []
12
for (i = 0; i < newBin.length; i++) {
13
binCode.push(String.fromCharCode(parseInt(newBin[i], 2)))
14
}
15
return binCode.join("")
16
}
17
18
async function eBinary(str = ''){
19
let res = ''
20
res = str.split('').map(char => {
21
return char.charCodeAt(0).toString(2);
22
}).join(' ')
23
return res
24
}
25
26
module.exports = { dBinary, eBinary }
27