Jump to content

Base58Check encoding: Difference between revisions

m
→‎version 3: changed whitespace in comment.
m (→‎version 3: simplified code, changed comments and whitespace.)
m (→‎version 3: changed whitespace in comment.)
Line 1,235:
exit 0 /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
B58: parse arg z 1 oz,,$; L1= 0; hex= 0; if z='' then return /*Z missing?*/
if \datatype(z, 'W') | arg()>1 then do; hex= 1; z= c2d(z); end /*IsZ Zin missinghex? */
if \datatype(z, 'W') | arg()>1 then do; hex= 1; z= c2d(z); end /*is Z in hex?*/
if left(z, 1)==1 then L1= verify(z ., 1) - 1 /*count number of leading ones (1's)*/
do until z==0; $= substr(@, z//58 +1, 1)$; z= z % 58
Cookies help us deliver our services. By using our services, you agree to our use of cookies.