MCPcopy Create free account
hub / github.com/StackStorm/st2 / pkcs5_unpad

Function pkcs5_unpad

st2common/st2common/util/crypto.py:428–438  ·  view source on GitHub ↗

Unpad data padded using PKCS5.

(data)

Source from the content-addressed store, hash-verified

426
427
428def pkcs5_unpad(data):
429 """
430 Unpad data padded using PKCS5.
431 """
432 if isinstance(data, six.binary_type):
433 # Make sure we are operating with a string type
434 data = data.decode("utf-8")
435
436 pad = ord(data[-1])
437 data = data[:-pad]
438 return data
439
440
441def Base64WSEncode(s):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected