05AB1E
05AB1E copied to clipboard
Program to demonstrate name
I have a program here that demonstrates how the name works.
Run this as program-name | base64
:
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
int le_hex = 0x1EAB05;
int be_hex = 0x05AB1E;
static inline int is_le(void)
{
unsigned a;
srand(time(NULL));
a = rand()%0x100;
if(*(unsigned char *)&a == a)
return 1;
else
return 0;
}
int main(void)
{
void *hex = is_le() ? &le_hex : &be_hex;
((char *)hex)[4] = 0;
fputs(hex, stdout);
return 0;
}
I had to reverse the name in hex for my little-endian machine, though.
Pure bash: echo "05ab1e" | xxd -ps -r | base64 -