Translate the hash to shard id

The shard nr is evaluated as follows:
new Murmur3HashFunction().hash("route2") % SHARD_NR

How is it mapped to the shard id or shard name values?

Does this relate to How to calculate the shard id/name for given routing string??

Well in some way yes.