MCPcopy Create free account
hub / github.com/ActiveState/code / key

Function key

recipes/Python/496857_zcryptpy/recipe-496857.py:23–28  ·  view source on GitHub ↗

Returns a valid key.

(definition, select)

Source from the content-addressed store, hash-verified

21
22
23def key(definition, select):
24 'Returns a valid key.'
25 key = range(256)
26 for index in range(256):
27 key[ord(definition[index * 2 + int(bool(select))])] = definition[index * 2 + int(not bool(select))]
28 return ''.join(key)
29
30def transform(key, string):
31 'Returns a valid transformation.'

Callers 15

recipe-579002.jsFile · 0.50
imergeFunction · 0.50
recipe-522990.pyFile · 0.50
__init__Method · 0.50
__call__Method · 0.50
__init__Method · 0.50
uniqueFunction · 0.50
__init__Method · 0.50
partitionFunction · 0.50
rpartitionFunction · 0.50
lower_boundFunction · 0.50
upper_boundFunction · 0.50

Calls 2

rangeFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected