jimmysong / programmingbitcoin

Repository for the book
Other
1.75k stars 656 forks source link

Chapter 4 return value for decode_base58 function #272

Closed derekpa closed 1 year ago

derekpa commented 1 year ago

Currently in Chapter 4.

The decode_base58 function in helper.py returns the value combined[1:-4]

Why is it not combined[:-4]? Why are you also slicing off the first byte? I assume this is not an error since the code in future chapters is the same, but it makes no sense to me.

Unless is this to remove a prefix (flag) later on? But then this seems an odd place to do it.

Thanks

derekpa commented 1 year ago

Closing my old question.

It removes the prefix before returning was the answer.