Digest implementation fully working
Modified hexdigest to use digest first