make version 0.1.* properly handle future version 2 addresses #23

Merged
Atheros1 merged 1 commits from master into master 2013-01-11 23:22:40 +01:00
Showing only changes of commit c9ba81f476 - Show all commits

View File

@ -162,7 +162,7 @@ def decodeAddress(address):
#print 'addressVersionNumber', addressVersionNumber #print 'addressVersionNumber', addressVersionNumber
#print 'bytesUsedByVersionNumber', bytesUsedByVersionNumber #print 'bytesUsedByVersionNumber', bytesUsedByVersionNumber
if addressVersionNumber < 1: if addressVersionNumber != 1:
print 'cannot decode version address version numbers this high' print 'cannot decode version address version numbers this high'
status = 'versiontoohigh' status = 'versiontoohigh'
return status,0,0,0 return status,0,0,0
@ -252,7 +252,7 @@ if __name__ == "__main__":
#print 'lengh of a at beginning = ', len(a) #print 'lengh of a at beginning = ', len(a)
print 'This is the data to be encoded in the address: ', a.encode('hex') print 'This is the data to be encoded in the address: ', a.encode('hex')
returnedAddress = encodeAddress(5,8,ripe.digest()) returnedAddress = encodeAddress(1,8,ripe.digest())
status,addressVersionNumber,streamNumber,data = decodeAddress(returnedAddress) status,addressVersionNumber,streamNumber,data = decodeAddress(returnedAddress)
print returnedAddress print returnedAddress
print 'Status:', status print 'Status:', status