Spaces:
Paused
Paused
Download lib/binary.cjs from arabdullah/ethix-md-user-4: direct link, hf CLI and curl.
- Browser
- Download file 421 Bytes
-
https://huggingface.co/spaces/arabdullah/ethix-md-user-4/resolve/main/lib/binary.cjs
- Command line
-
hf download hf://spaces/arabdullah/ethix-md-user-4/lib/binary.cjs
-
curl -L -o binary.cjs https://huggingface.co/spaces/arabdullah/ethix-md-user-4/resolve/main/lib/binary.cjs
421 Bytes
| async function dBinary(str) { | |
| var newBin = str.split(" ") | |
| var binCode = [] | |
| for (i = 0; i < newBin.length; i++) { | |
| binCode.push(String.fromCharCode(parseInt(newBin[i], 2))) | |
| } | |
| return binCode.join("") | |
| } | |
| async function eBinary(str = ''){ | |
| let res = '' | |
| res = str.split('').map(char => { | |
| return char.charCodeAt(0).toString(2); | |
| }).join(' ') | |
| return res | |
| } | |
| module.exports = { dBinary, eBinary } |