Just a thought but I would advise against storing anything really important in your hat. In my experience, hats are lost more frequently than any other piece of hiking gear. So while it might work as a yet another backup I wouldn't personally rely on any last-ditch kit stored in my hat.
WARNING & DISCLAIMER:
SELECT AND USE OUTDOORS AND SURVIVAL EQUIPMENT, SUPPLIES AND TECHNIQUES AT YOUR OWN RISK. Information posted
on this forum is not reviewed for accuracy and may not be reliable, use at your own risk. Please
review the full WARNING & DISCLAIMER about information on this
site.