Using function extension is totally valid here. But I think in this case calculated (or computed) property is also valid. Md5 calculation depends on content of the string, at the same time it doesn’t change string content and doesn’t require extra arguments (only string itself).
Game and software developer with more than 15 years experience. Founder and CEO at Mariposa Studios, freelancer.
Love podcasts or audiobooks? Learn on the go with our new app.