cosmopolitan/libc/testlib/fastrandomstring.h
Justine Tunney fa20edc44d
Reduce header complexity
- Remove most __ASSEMBLER__ __LINKER__ ifdefs
- Rename libc/intrin/bits.h to libc/serialize.h
- Block pthread cancelation in fchmodat() polyfill
- Remove `clang-format off` statements in third_party
2023-11-28 14:39:42 -08:00

14 lines
406 B
C

#ifndef COSMOPOLITAN_LIBC_TESTLIB_FASTRANDOMSTRING_H_
#define COSMOPOLITAN_LIBC_TESTLIB_FASTRANDOMSTRING_H_
static inline const char *FastRandomString(void) {
static unsigned long t;
static union {
unsigned long x;
char b[sizeof(unsigned long)];
} u;
u.x = (t = (t * 0xdeaadead) + 0xdeaadead) & 0x7e7e7e7e7e7e7e;
return u.b;
}
#endif /* COSMOPOLITAN_LIBC_TESTLIB_FASTRANDOMSTRING_H_ */