Created
September 18, 2023 08:38
-
-
Save quentint/129b9811c3fb99278a89597312453766 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bitsToCharacter(bits: string): string { | |
console.assert(bits.match(/^[01]{6}$/) !== null, 'Bits must only contain 6 0 and 1 characters (width is 2 and height is 3)') | |
return String.fromCharCode(parseInt(bits.split('').reverse().join(''), 2) + 32) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment