For licensing, you can create hash based on user's hardware. But this approach has a disadvantage. When user's change their hardware, the software will not work and user has to buy another license.
Better approach is having a licence server using user's MAC addresses. User's buy their licence, they sign in your app and server approves that request. This approach allows users to move it to new hardware, even new computer.