Digital topological method for computing genus and the Betti numbers