PageSourceSearch

https://opentofu.pages.dev/assets/js/4f38bb92.716d79cc.js

js opentofu.pages.dev collected 2026-10-03 05:29:01 UTC 3,928 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkwebsite=globalThis.webpackChunkwebsite||[]).push([[1665],{88573(e,n,s){s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>h,default:()=>d,frontMatter:()=>o,metadata:()=>a,toc:()=>c});let a=JSON.parse('{"id":"language/functions/base64sha512","title":"base64sha512 Function","description":"The base64sha512 function computes the SHA512 hash of a given string and\\nencodes it with Base64.","source":"@site/versioned_docs/version-v1.10/language/functions/base64sha512.mdx","sourceDirName":"language/functions","slug":"/language/functions/base64sha512","permalink":"/docs/v1.10/language/functions/base64sha512","draft":false,"unlisted":false,"editUrl":"https://github.com/opentofu/opentofu/edit/v1.10/website/docs/language/functions/base64sha512.mdx","tags":[],"version":"v1.10","frontMatter":{"sidebar_label":"base64sha512","description":"The base64sha512 function computes the SHA512 hash of a given string and\\nencodes it with Base64."},"sidebar":"docs","previous":{"title":"base64sha256","permalink":"/docs/v1.10/language/functions/base64sha256"},"next":{"title":"basename","permalink":"/docs/v1.10/language/functions/basename"}}');var t=s(74848),i=s(28453);let o={sidebar_label:"base64sha512",description:"The base64sha512 function computes the SHA512 hash of a given string and\nencodes it with Base64."},h="base64sha512 Function",r={},c=[{value:"Examples",id:"examples",level:2},{value:"Related Functions",id:"related-functions",level:2}];function l(e){let n={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsxs)(n.h1,{id:"base64sha512-function",children:[(0,t.jsx)(n.code,{children:"base64sha512"})," Function"]})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"base64sha512"})," computes the SHA512 hash of a given string and encodes it with\nBase64. This is not equivalent to ",(0,t.jsx)(n.code,{children:'base64encode(sha512("test"))'})," since ",(0,t.jsx)(n.code,{children:"sha512()"}),"\nreturns hexadecimal representation."]}),"\n",(0,t.jsxs)(n.p,{children:["The given string is first encoded as UTF-8 and then the SHA512 algorithm is applied\nas defined in ",(0,t.jsx)(n.a,{href:"https://tools.ietf.org/html/rfc4634",children:"RFC 4634"}),'. The raw hash is\nthen encoded with Base64 before returning. OpenTofu uses the "standard" Base64\nalphabet as defined in ',(0,t.jsx)(n.a,{href:"https://tools.ietf.org/html/rfc4648#section-4",children:"RFC 4648 section 4"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'> base64sha512("hello world")\nMJ7MSJwS1utMxA9QyQLytNDtd+5RGnx6m808qG1M2G+YndNbxf9JlnDaNCVbRbDP2DDoH2Bdz33FVC6TrpzXbw==\n'})}),"\n",(0,t.jsx)(n.h2,{id:"related-functions",children:"Related Functions"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"/docs/v1.10/language/functions/filebase64sha512",children:(0,t.jsx)(n.code,{children:"filebase64sha512"})})," calculates the same hash from\nthe contents of a file rather than from a string value."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.a,{href:"/docs/v1.10/language/functions/sha512",children:(0,t.jsx)(n.code,{children:"sha512"})})," calculates the same hash but returns the result\nin a more-verbose hexadecimal encoding."]}),"\n"]})]})}function d(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},28453(e,n,s){s.d(n,{R:()=>o,x:()=>h});var a=s(96540);let t={},i=a.createContext(t);function o(e){let n=a.useContext(i);return a.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function h(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.