Fixed google style docstrings in addresses
This commit is contained in:
parent
aa7e7dd658
commit
a7da0c0eff
|
@ -1,7 +1,5 @@
|
||||||
"""
|
"""
|
||||||
src/addresses.py
|
Operations with addresses
|
||||||
================
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# pylint: disable=redefined-outer-name,inconsistent-return-statements
|
# pylint: disable=redefined-outer-name,inconsistent-return-statements
|
||||||
|
|
||||||
|
@ -18,8 +16,9 @@ ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|
||||||
def encodeBase58(num, alphabet=ALPHABET):
|
def encodeBase58(num, alphabet=ALPHABET):
|
||||||
"""Encode a number in Base X
|
"""Encode a number in Base X
|
||||||
|
|
||||||
`num`: The number to encode
|
Args:
|
||||||
`alphabet`: The alphabet to use for encoding
|
num: The number to encode
|
||||||
|
alphabet: The alphabet to use for encoding
|
||||||
"""
|
"""
|
||||||
if num == 0:
|
if num == 0:
|
||||||
return alphabet[0]
|
return alphabet[0]
|
||||||
|
@ -27,7 +26,6 @@ def encodeBase58(num, alphabet=ALPHABET):
|
||||||
base = len(alphabet)
|
base = len(alphabet)
|
||||||
while num:
|
while num:
|
||||||
rem = num % base
|
rem = num % base
|
||||||
# print 'num is:', num
|
|
||||||
num = num // base
|
num = num // base
|
||||||
arr.append(alphabet[rem])
|
arr.append(alphabet[rem])
|
||||||
arr.reverse()
|
arr.reverse()
|
||||||
|
@ -37,9 +35,9 @@ def encodeBase58(num, alphabet=ALPHABET):
|
||||||
def decodeBase58(string, alphabet=ALPHABET):
|
def decodeBase58(string, alphabet=ALPHABET):
|
||||||
"""Decode a Base X encoded string into the number
|
"""Decode a Base X encoded string into the number
|
||||||
|
|
||||||
Arguments:
|
Args:
|
||||||
- `string`: The encoded string
|
string: The encoded string
|
||||||
- `alphabet`: The alphabet to use for encoding
|
alphabet: The alphabet to use for encoding
|
||||||
"""
|
"""
|
||||||
base = len(alphabet)
|
base = len(alphabet)
|
||||||
num = 0
|
num = 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user