sha256-of-base64
Invicton-Labs/sha256-of-base64/null
Terraform SHA256 of Base64 This module is functionally equivalent to sha256(base64decode(var.content_base64)) (hex output) and base64sha256(base64decode(var.content_base64)) (base64 output), except that it functions even when content_base64 does not decode to valid UTF-8. This module has been tested on Linux and Windows, but not macOS. In theory, it should function on any Unix-based OS that supports bash, base64, and sha256sum commands, or any Windows-based OS that supports PowerShell. Usage `` locals { // foo is a base64-encoded string of some binary that does not represent valid UTF-8 foo_b64 = "0000" foo_sha256_hex = sha256(base64decode(local.foo_b64)) foo_sha256_b64 = base64sha256(base64decode(local.foo_b64)) } output "sha256_hex" { value = local.foo_sha256_hex } output "sha256_b64" {
| Name | Type | Description | Default |
|---|---|---|---|
| content_base64 | string | The base64-encoded content to get the SHA256 hash of. | required |
base64 — The base64-encoded SHA256 hash of the decoded base64 content.hex — The hex-encoded SHA256 hash of the decoded base64 content. Will always use lower-case letters.