def _sign_string(account_key, string_to_sign): decoded_account_key = _decode_base64_to_bytes(account_key) if isinstance(string_to_sign, _unicode_type): string_to_sign = string_to_sign.encode('utf-8') signed_hmac_sha256 = hmac.HMAC(decoded_account_key, string_to_sign, hashlib.sha256) digest = signed_hmac_sha256.digest() encoded_digest = _encode_base64(digest) return encoded_digest
def _from_entity_binary(value): return EntityProperty('Edm.Binary', _decode_base64_to_bytes(value))