mischiefadd cf1b376511 years agoHistory
30 lines · 438 B · C
RawDownload
#include <u.h> // returns 1 if x == y, otherwise 0.intconstbeq(uchar x, uchar y) {	uchar z; 	z = ~(x ^ y);        z &= (z >> 4);        z &= (z >> 2);        z &= (z >> 1); 	return z;} // returns 1 if the the len bytes in x are equal to len bytes in y,// otherwise returns 0.intconstcmp(uchar *x, uchar *y, int len) {	uchar z;	int i; 	z = 0; 	for(i = 0; i < len; i++) {		z |= x[i] ^ y[i];	} 	return constbeq(z, 0);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t