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

Function dec2bin

Python/des.py:75–83  ·  view source on GitHub ↗
(num)

Source from the content-addressed store, hash-verified

73
74
75def dec2bin(num):
76 res = bin(num).replace("0b", "")
77 if(len(res) % 4 != 0):
78 div = len(res) / 4
79 div = int(div)
80 counter = (4 * (div + 1)) - len(res)
81 for i in range(0, counter):
82 res = '0' + res
83 return res
84
85# Permute function to rearrange the bits
86

Callers 1

encryptFunction · 0.85

Calls 1

binFunction · 0.85

Tested by

no test coverage detected