Bitcoin/public point to address: Difference between revisions

(Use the .polymod method)
Line 586:
=={{header|zkl}}==
Uses shared library zklMsgHash.
<lang zkl>var [const] MsgHash=Import.lib("zklMsgHash"); // SHA-256, etc
 
const symbols = "123456789" // 58 characters: no cap i,o; ell, zero
Line 608:
fcn coinEncode(x,y){ // throws if x or y not hex or (x+y) not even length
bytes:=(x+y).pump(Data,Void.Read,fcn(a,b){ (a+b).toInt(16) }).insert(0,4);
bytes=(MsgHash.SHA256(bytes,1,Falsebytes) : MsgHash.RIPEMD160(_,1,Falsebytes))
.insert(0,COIN_VER); // we are using bytes for in and out
d,chkSum := Data(), MsgHash.SHA256(bytes,1,Falsed) : MsgHash.SHA256(_,1,Falsed)[0,4];
base58Encode(bytes.append(chkSum.del(4,*))); // first 4 bytes of hashed hash
}</lang>
<lang zkl>e:=coinEncode(
Anonymous user