Refactor Hash interfaces and centralize hash function. This will allow easier introduction of different hash function later on. This forms the "no-op" part of the SHA256 enablement patch.
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Repository creation depends on many models, so moving it to service layer is better.