in reply to BCH (CashAddress) wallet validation
perhaps this documentation on a polymod function will help you understand what it does (even though I know this is Perl 6 documentation): https://docs.perl6.org/routine/polymod.
HTH.