There's really no good reason to have it part of script.py. This is part of an effort to make script.py independent of the rest of the framework so we can use it in the plugin system.
In the future, we can move the other hash frunctions from messages.py to hash.py, too.