Let's just make this a class method (either on this class or a helper class.) I'd prefer to not clutter the core classes with extensions from my libraries (to be as kind as possible to library users.)