On the thumb side; it's the radial nerve
On the pinkie side, and this is more common, its the ulnar nerve. Could also be higher up in a nexus called the brachial plexus. Ulnar nerve has a notch at the elbow causing the "funny bone" sensation. Can also happen from sleepin in a vulnerable position that causes pressure on the nerve.