[BUGFIX] Make ``resource://`` URIs work with 40 character Package Keys
The Flow ``ResourceStreamWrapper`` transparently handles resource URLs
in the formats ``resource://<SHA1>`` (referring to the SHA1 hash of a
Flow Resource) and ``resource://Package.Key/some/path`` (referring to
a local file path relative to the specified package's Resources
Currently the detection of a SHA1 hash is unreliably only checking for
the string length being 40 characters. If a Package Key happens to be
exactly 40 characters long, static resources can't be loaded.
This change fixes the issue by replacing the ``strlen`` check with a
simple regular expression lookup that only accepts valid SHA1 hashes.
Releases: master, 3.0, 2.3, 2.2, 2.1