mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-02 11:42:37 +00:00
dfb35dcd7a
Add a generic crypto.Hash template function returning the hex-encoded checksum of a string using one of md5, sha1, sha256 (default), sha384 or sha512. The supported algorithms match those used for the SRI hash in .Data.Integrity on fingerprinted resources, so an SRI hash can be built by composing with encoding.HexDecode and encoding.Base64Encode. Fixes #15072 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
16 lines
338 B
Markdown
16 lines
338 B
Markdown
---
|
|
title: encoding.HexEncode
|
|
description: Returns the hexadecimal encoding of the given content.
|
|
categories: []
|
|
keywords: []
|
|
params:
|
|
functions_and_methods:
|
|
aliases: []
|
|
returnType: string
|
|
signatures: [encoding.HexEncode INPUT]
|
|
---
|
|
|
|
```go-html-template
|
|
{{ "Hello world" | encoding.HexEncode }} → 48656c6c6f20776f726c64
|
|
```
|