Extract hash of various length