Was James Moriarty really based on Adam Worth?

It says here in this book that Sherlock Holmes great adversary was based on the real-life antics of one Adam Worth.
Is this really the case? I know authors have this tendency to sometimes over-embellish things, so what’s the SD here?

Why did A.C. Doyle pick Worth to base his character on? Did he think of the character first and then base it on Worth or did he base it exclusively on Worth himself?

And Moriarty was a mathematician???

I do not know what Doyle was thinking when he created Professor Moriarty but it seems others share the view that Moriarty was based at least in part on Worth. Perhaps Doyle, in order to create or more fully realized character, sought around for someone to use as a template. This is a common thing for writers to do and in this case Worth seems to fit what Doyle was after to an extent.