Get the current core ID on the core itself?

Thanks @zach , this works great!! Here is the code for it. The only thing is that while testing the code, I was able to get good results reading the results over serial, but I can’t read it over the cloud API. Do you know why?

#include <string.h>
char* id3;
char id[12];
char id2[100];
void setup() 
{
     Serial.begin(9600);
     
     Spark.variable("id3", &id3, STRING);
   }

void loop() {
delay(1000);
id3 = coreid();
Serial.println("The Core id is: ");
Serial.println(coreid());

}

char* coreid()
{
     int x=0;
     memcpy(id, (char *)ID1, 12);
     char hex_digit;
     
     for (int i = 0; i < 12; ++i)
     {
       hex_digit = 48 + (id[i] >> 4);
       if (57 < hex_digit)
         hex_digit += 39;
         id2[x]=hex_digit;
         x = x +1;
       hex_digit = 48 + (id[i] & 0xf);
       if (57 < hex_digit)
         hex_digit += 39;
         id2[x]=hex_digit;
         x = x +1;
     }
     return id2;
}