package Ġk Coin Ċ Ċ import Ġjava . math . BigInteger Ċ import Ġjava . security . Message Digest Ċ Ċ fun ĠString . hash ( algorithm : ĠString Ġ= Ġ" SHA - 2 5 6 "): ĠString Ġ{ ĊĠĠĠ Ġval Ġmessage Digest Ġ= ĠMessage Digest . getInstance ( algorithm ) ĊĠĠĠ Ġmessage Digest . update ( this . toByteArray ()) ĊĠĠĠ Ġreturn ĠString . format ("% 0 6 4 x ", ĠBigInteger ( 1 , Ġmessage Digest . digest ())) Ċ }