コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
def _from_entity_binary(value):
    return EntityProperty('Edm.Binary', _decode_base64_to_bytes(value))
コード例 #4
0
def _from_entity_binary(value):
    return EntityProperty('Edm.Binary', _decode_base64_to_bytes(value))