Код: Выделить всё
signed_str = hmac.new(bytes(secret_key, 'latin-1'),
msg=bytes(prepared_str, 'latin-1'),
digestmod=hashlib.sha256).hexdigest().lower()
Код: Выделить всё
$signed_str = strtolower( base64_encode (hash_hmac('sha256',$prepared_str , $secretKey) ) ) ;
И когда мы этим займемся, было бы идеально, если бы у hexdigest был эквивалент php. .
Подробнее здесь: https://stackoverflow.com/questions/791 ... -in-python
Мобильная версия