⚠️ Note that this post hasn't been updated for at least a year and the information may be outdated, proceed with caution! (Last updated: March 12, 2020)
Sometimes you may want to use a unique ID for a custom module. You can create an ID using the following HubL snippet:
{% raw %}{% set mid = module | pprint | md5 %}
Then you can use that ID to create a unique CSS ID, for example:
<div id="section-{{ mid }}">
My DIV
</div>
which will print out something like:
<div id="section-6219837888e9769f1d695d05b73a8256">
My DIV
</div>