Lambda source_code_hash

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function#source_code_hash

could somebody provide equivalent of filebase64sha256("file.zip") however using S3? seems to be missing in docs, some solutions I found use s3 object - but this is when you use terraform to manage the file, I want to detect change of file without versioning on in s3

does it needs only s3_bucket, s3_key and source_code_hash = filebase64sha256(s3_key) - seems to be not working and looking for local file … how to pass s3_key to function?