Skip to content

Instantly share code, notes, and snippets.

@ppkn
Created October 31, 2025 11:07
Show Gist options
  • Select an option

  • Save ppkn/d52b7e8f3e391b71444fab0a3b439ccc to your computer and use it in GitHub Desktop.

Select an option

Save ppkn/d52b7e8f3e391b71444fab0a3b439ccc to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "tagStandard52h13.c"
#define NUM_CODES 48714
int main(int argc, char *argv[]) {
if (argc != 2) {
fprintf(stderr, "Usage: %s <n>\n", argv[0]);
return 1;
}
int n = atoi(argv[1]);
if (n <= 0) {
printf("[]\n");
return 0;
}
if (n > NUM_CODES) {
fprintf(stderr, "Error: n is larger than the number of available codes (%d).\n", NUM_CODES);
n = NUM_CODES;
}
printf("[");
for (int i = 0; i < n; i++) {
// Print the code in hexadecimal format with 'n' suffix for BigInt
printf("0x%llx", (unsigned long long)codedata[i]);
if (i < n - 1) {
printf("n,");
} else {
printf("n");
}
}
printf("]\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment