@@ -227,10 +227,10 @@ All-in-one "best-of-both-worlds" helper - first hash with sha256 and than hash w
227
227
228
228
229
229
``` ruby
230
- hash160( ' 02b9d1cc0b793b03b9f64d022e9c67d5f32670b03f636abf0b3147b34123d13990' ).hexdigest
230
+ hash160( hex: ' 02b9d1cc0b793b03b9f64d022e9c67d5f32670b03f636abf0b3147b34123d13990' ).hexdigest
231
231
# => "e6b145a3908a4d6616b13c1109717add8672c900"
232
232
233
- hash160( ' 02b4632d08485ff1df2db55b9dafd23347d1c47a457072a1e87be26896549a8737' ).hexdigest
233
+ hash160( hex: ' 02b4632d08485ff1df2db55b9dafd23347d1c47a457072a1e87be26896549a8737' ).hexdigest
234
234
# => "93ce48570b55c42c2af816aeaba06cfee1224fae"
235
235
```
236
236
@@ -245,10 +245,11 @@ All-in-one double sha256 hash helper, that is, first hash with sha256 and than h
245
245
246
246
247
247
``` ruby
248
- hash256( ' 6fe6b145a3908a4d6616b13c1109717add8672c900' ).hexdigest
248
+ hash256( hex: ' 6fe6b145a3908a4d6616b13c1109717add8672c900' ).hexdigest
249
249
# => "02335f08b8fe4ddad263a50b7a33c5d38ea1cbd8fd2056a1320a3ddece541711"
250
250
```
251
251
252
+
252
253
#### Base58 Encoding / Decoding Helpers
253
254
254
255
** BASE58**
@@ -341,7 +342,7 @@ Sign a transaction with an (elliptic curve) private key:
341
342
``` ruby
342
343
# Step 1 - Calculate the Transaction (tx) Hash
343
344
tx = ' from: Alice to: Bob cryptos: 43_000_000_000'
344
- txhash = sha256( tx ).hexdigest
345
+ txhash = sha256( tx )
345
346
346
347
# Step 2 - Get the Signer's Private key
347
348
private_key = EC ::PrivateKey .new ( 1234 ) # This private key is just an example. It should be much more secure!
@@ -368,7 +369,7 @@ Verify a signed transaction with an (elliptic curve) public key:
368
369
``` ruby
369
370
# Step 1 - Calculate the Transaction (tx) Hash
370
371
tx = ' from: Alice to: Bob cryptos: 43_000_000_000'
371
- txhash = sha256( tx ).hexdigest
372
+ txhash = sha256( tx )
372
373
373
374
# Step 2 - Get the Signer's Public Key
374
375
public_key = EC ::PublicKey .new (
0 commit comments