I currently have a Javascript code that looks like this
var CryptoJS = require("crypto-js");
var key = "bookbookbook";
var msg = "2020-06-16 20:03:19";
var signature = CryptoJS.HmacSHA1(msg, key);
var checksum = CryptoJS.enc.Utf8.parse(signature);
console.log("checksum: " + CryptoJS.enc.Base64.stringify(checksum));
the checksum is ODNjOWY5NThmYzUxODNkYWM1MjhjZTY3ZTYzYmQxNjE1ZDRkZDQ5Zg==
I tried to convert it to Python
import base64
import time
import hmac
import hashlib
key = "bookbookbook".encode(encoding='utf-8')
msg = "2020-06-16 20:03:19".encode(encoding='utf-8')
digest = hmac.new(key, msg, hashlib.sha1).digest()
checksum = base64.b64encode(digest).decode('utf-8')
print(checksum)
but the checksum returned is this g8n5WPxRg9rFKM5n5jvRYV1N1J8=
How do I make it return the same?
console.log(checksum)