encode_base64
encode_base64는 버퍼 또는 문자열을 base64 문자열로 인코딩합니다.
입력
| 이름 | 타입 | 설명 |
|---|---|---|
value | buffer, string, addon | 인코딩할 버퍼 또는 문자열입니다. '0x'로 시작하는 문자열은 16진수로 디코딩되며, 그렇지 않으면 원시 UTF-8 바이트가 사용됩니다. |
출력
| 이름 | 타입 | 설명 |
|---|---|---|
value | string | 입력값을 base64 문자열로 인코딩한 결과 |
output "encoded" {value = encode_base64("0x48656c6c6f20776f726c6421")}// > encoded: SGVsbG8gd29ybGQh
decode_base64
decode_base64는 base64로 인코딩된 문자열을 디코딩하여 결과를 버퍼로
반환합니다.
입력
| 이름 | 타입 | 설명 |
|---|---|---|
base64_string | string | 디코딩할 base64 문자열 |
출력
| 이름 | 타입 | 설명 |
|---|---|---|
value | buffer | 디코딩된 base64 문자열(버퍼 형식) |
output "decoded" {value = decode_base64("SGVsbG8gd29ybGQh")}// > decoded: 0x48656c6c6f20776f726c6421
Is this page helpful?