<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[M5Paper unique device identifier?]]></title><description><![CDATA[[[topic:post-is-deleted]]]]></description><link>https://community.m5stack.com/topic/2846/m5paper-unique-device-identifier</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 14:12:47 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2846.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Jan 2021 15:13:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5Paper unique device identifier? on Thu, 28 Jan 2021 17:39:58 GMT]]></title><description><![CDATA[<p dir="auto">Here is a solution to create an unique identifier that is based on the device's MAC address (but is not easy to guess and is not the MAC address itself):</p>
<pre><code>/** Returns a hashed uint64_t */
uint64_t getHashedInt64(uint64_t u)
{
    uint64_t v = u * 3935559000370003845 + 2691343689449507681;

    v ^= v &gt;&gt; 21;
    v ^= v &lt;&lt; 37;
    v ^= v &gt;&gt; 4;

    v *= 4768777513237032717;

    v ^= v &lt;&lt; 20;
    v ^= v &gt;&gt; 41;
    v ^= v &lt;&lt; 5;

    return v;
}

/** Return a device unique identifier based on device's mac address, eg. 6C4080B51A5D3659 */
String getUniqueId()
{
    uint64_t mac = ESP.getEfuseMac();
    uint64_t hash = getHashedInt64(mac);
    uint32_t msb = hash &gt;&gt; 32;
    uint32_t lsb = hash &amp; 0xFFFFFFFF;

    char unique_id[20];
    sprintf(unique_id, "%08X%08X", msb, lsb);
    return String(unique_id);
}
</code></pre>
<p dir="auto">Calling:<br />
<code>getUniqueId() returns something like 6C4080B51A5D3659</code></p>
]]></description><link>https://community.m5stack.com/post/12125</link><guid isPermaLink="true">https://community.m5stack.com/post/12125</guid><dc:creator><![CDATA[gionata]]></dc:creator><pubDate>Thu, 28 Jan 2021 17:39:58 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper unique device identifier? on Thu, 28 Jan 2021 15:43:20 GMT]]></title><description><![CDATA[<p dir="auto">Actually, my bad, I ran the same code again on 3 different M5Paper and it is indeed working...</p>
<p dir="auto">So yes, getMACString is returning a unique id.</p>
<p dir="auto">`<br />
[global_setting.cpp:70] getMACString(): MAC = 0000CC240805613C<br />
[main.cpp:261] run(): getEfuseMac: 0805613C</p>
<p dir="auto">[global_setting.cpp:70] getMACString(): MAC = 0000CC370805613C<br />
[main.cpp:261] run(): getEfuseMac: 0805613C</p>
<p dir="auto">[global_setting.cpp:70] getMACString(): MAC = 000084170905613C<br />
[main.cpp:261] run(): getEfuseMac: 0905613C<br />
`</p>
<p dir="auto">Thanks</p>
]]></description><link>https://community.m5stack.com/post/12120</link><guid isPermaLink="true">https://community.m5stack.com/post/12120</guid><dc:creator><![CDATA[gionata]]></dc:creator><pubDate>Thu, 28 Jan 2021 15:43:20 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper unique device identifier? on Thu, 28 Jan 2021 15:19:08 GMT]]></title><description><![CDATA[<p dir="auto">Hello, does the getEfuseMac return you the same value? you can try to generate a value one time and keep it inside the device for use later.</p>
]]></description><link>https://community.m5stack.com/post/12115</link><guid isPermaLink="true">https://community.m5stack.com/post/12115</guid><dc:creator><![CDATA[Zontex]]></dc:creator><pubDate>Thu, 28 Jan 2021 15:19:08 GMT</pubDate></item></channel></rss>