I hereby claim:
- I am llzes on github.
- I am av1 (https://keybase.io/av1) on keybase.
- I have a public key whose fingerprint is 31FE DE35 59A1 B2FF 413F 0C9D FD2E C57F 49DA B6B6
To claim this, I am signing this object:
const byteToHex = (byte) => { | |
const key = '0123456789abcdef' | |
let bytes = new Uint8Array(byte) | |
let newHex = '' | |
let currentChar = 0 | |
for (let i=0; i<bytes.length; i++) { // Go over each 8-bit byte | |
currentChar = (bytes[i] >> 4) // First 4-bits for first hex char | |
newHex += key[currentChar] // Add first hex char to string | |
currentChar = (bytes[i] & 15) // Erase first 4-bits, get last 4-bits for second hex char | |
newHex += key[currentChar] // Add second hex char to string |
I hereby claim:
To claim this, I am signing this object:
def fizzbuzz(num): | |
# i, 3, 5, 15, 7, 21, 35, 105, 11, 33, 77, 165, 231, 385, 1155 | |
outcomes = [str(num), "bun", "cheese", "buncheese", "cake", "buncake", "cheesecake", "buncheesecake", "fluff", "bunfluff", "cheesefluff", "buncheesefluff", "cakefluff", "buncakefluff", "cheesecakefluff", "buncheesecakefluff"] | |
# 0b01 = 1 in binary; &1 = %2, to zero out all bits except for the right most to see if it's a non empty number | |
divByBun = 1 - ( ( (num%3) | (num%3>>1) ) & (0b01) ) | |
divByCheese = (1 - ( ( (num%5) | (num%5>>1) | num%5>>2 ) & (0b01) ) ) * 2 | |
divByCake = (1- ( ( (num%7) | (num%7>>1) | num%7>>2 ) & (0b01) ) ) * 4 | |
divByFluff = (1- ( ( (num%11) | (num%11>>1) | num%11>>2 | num%11>>3 ) & (0b01) ) ) * 8 | |
i = divByBun ^ divByCheese ^ divByCake ^ divByFluff | |
return outcomes[i] |
const base64ToByte = (base64) => { | |
const key = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
let newBytes = [] | |
let currentChar = 0 | |
let currentByte = 0 | |
for (let i=0; i<base64.length; i++) { // Go over four 6-bit base64 chars to decode into three 8-bit bytes | |
currentChar = key.indexOf(base64[i]) | |
if (i%4===0) { // First base64 char | |
currentByte = (currentChar << 2) // Get the 6-bits from first base64 char | |
} |
I hereby claim:
To claim this, I am signing this object:
### Keybase proof | |
I hereby claim: | |
* I am Avizc on github. | |
* I am av1 (https://keybase.io/av1) on keybase. | |
* I have a public key whose fingerprint is ADC0 4F30 2230 9853 9EF2 F6BA A975 B74E 7C86 777E | |
To claim this, I am signing this object: |
I hereby claim:
To claim this, I am signing this object: