MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / bin2dec

Function bin2dec

Python/des.py:61–70  ·  view source on GitHub ↗
(binary)

Source from the content-addressed store, hash-verified

59
60
61def bin2dec(binary):
62
63 binary1 = binary
64 decimal, i, n = 0, 0, 0
65 while(binary != 0):
66 dec = binary % 10
67 decimal = decimal + dec * pow(2, i)
68 binary = binary//10
69 i += 1
70 return decimal
71
72# Decimal to binary conversion
73

Callers 1

encryptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected