Pretty sure there's already an easy webtool out there for that but this should be pretty easy to code. Let me do some searching
Discussion
damus has a web tool, i just need to convert users npup to hex to add to my relays via PR, i don't want to mak a web request for it.