Anonymous user
Bitcoin/public point to address: Difference between revisions
Improved D entry
(Added zkl) |
(Improved D entry) |
||
Line 101:
=={{header|D}}==
Requires the second D module from the SHA-256 task.
{{trans|C}}
{{trans|Go}}
<lang d>import std.stdio, std.algorithm, std.digest.ripemd,
// A Bitcoin public point.
Line 115:
/
char[] toBase58(ref Address a) pure nothrow @safe {▼
▲char[] toBase58(ref Address a) pure nothrow {
static immutable symbols = "123456789" ~
"ABCDEFGHJKLMNPQRSTUVWXYZ" ~
Line 127 ⟶ 126:
uint c = 0;
foreach (ref ai; a) {
ai =
c
}
ri = symbols[c % symbols.length];
}
|