I hereby claim:
- I am ttaubert on github.
- I am ttaubert (https://keybase.io/ttaubert) on keybase.
- I have a public key whose fingerprint is B1CB F850 F25E 7B7B 8C91 9AA6 4DD9 6198 4B92 E4F2
To claim this, I am signing this object:
#include <stdint.h> | |
// 0xff if MSB(x) = 1 else 0x00 | |
uint8_t msb(uint8_t x) { | |
return 0 - (x >> (8 * sizeof(x) - 1)); | |
} | |
// 0xff if a >= b else 0x00 | |
uint8_t nz(uint8_t x) { | |
return ~msb(~x & (x - 1)); |
#include <stdint.h> | |
uint8_t add(uint8_t a, uint8_t b) { | |
uint8_t sum = a + b; | |
return sum < a ? UINT8_MAX : sum; | |
} |
/* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | |
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
"use strict"; | |
/* | |
* thirty-two | |
* https://github.com/chrisumbel/thirty-two | |
* |
function*r(k){t=x=>(y=x%n)in s?s[y]:y;w=_=>t((s[i%n]=t(j+=f=t(i++)))+(s[j%n]=f));for(n=256,s=[i=j=0];i<n;)w(j+=k[i%k.length]);for(j=0,i=1;;)yield w()} | |
// A raw RC4 stream. | |
// Works in Firefox only (needs lots of ES6). | |
// 150 chars | |
// Usage: | |
for (var b of r([65,65,65])) { | |
console.log(b); | |
} |
I hereby claim:
To claim this, I am signing this object: