From f03f211b7138e22d1c98c54f1894c08439c840a7 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Wed, 10 Jul 2024 16:41:41 -0700 Subject: [PATCH] Add namespace for hash functions --- content/en/functions/crypto/FNV32a.md | 10 ++++++++-- content/en/functions/hash/FNV32a.md | 20 ++++++++++++++++++++ content/en/functions/hash/XxHash.md | 20 ++++++++++++++++++++ content/en/functions/hash/_index.md | 12 ++++++++++++ 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 content/en/functions/hash/FNV32a.md create mode 100644 content/en/functions/hash/XxHash.md create mode 100644 content/en/functions/hash/_index.md diff --git a/content/en/functions/crypto/FNV32a.md b/content/en/functions/crypto/FNV32a.md index eda303e62d..61c2f67305 100644 --- a/content/en/functions/crypto/FNV32a.md +++ b/content/en/functions/crypto/FNV32a.md @@ -1,11 +1,12 @@ --- title: crypto.FNV32a -description: Returns the FNV (Fowler–Noll–Vo) 32-bit hash of a given string. +description: Returns the 32-bit FNV (Fowler–Noll–Vo) non-cryptographic hash of the given string. categories: [] keywords: [] action: aliases: [] related: + - functions/hash/Xxhash - functions/crypto/HMAC - functions/crypto/MD5 - functions/crypto/SHA1 @@ -13,9 +14,14 @@ action: returnType: int signatures: [crypto.FNV32a STRING] aliases: [/functions/crypto.fnv32a] +expiryDate: 2024-07-31 # deprecated 2024-07-31 --- -This function calculates the 32-bit [FNV1a hash](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash) of a given string according to the [specification](https://datatracker.ietf.org/doc/html/draft-eastlake-fnv-12): +{{% deprecated-in 0.129.0 %}} +Use [`hash.FNV32a`] instead. + +[`hash.FNV32a`]: /functions/hash/FNV32a/ +{{% /deprecated-in %}} ```go-html-template {{ crypto.FNV32a "Hello world" }} → 1498229191 diff --git a/content/en/functions/hash/FNV32a.md b/content/en/functions/hash/FNV32a.md new file mode 100644 index 0000000000..7cabe4af44 --- /dev/null +++ b/content/en/functions/hash/FNV32a.md @@ -0,0 +1,20 @@ +--- +title: hash.FNV32a +description: Returns the 32-bit FNV (Fowler–Noll–Vo) non-cryptographic hash of the given string. +categories: [] +keywords: [] +action: + aliases: [] + related: + - functions/hash/Xxhash + - functions/crypto/HMAC + - functions/crypto/MD5 + - functions/crypto/SHA1 + - functions/crypto/SHA256 + returnType: int + signatures: [hash.FNV32a STRING] +--- + +```go-html-template +{{ hash.FNV32a "Hello world" }} → 1498229191 +``` diff --git a/content/en/functions/hash/XxHash.md b/content/en/functions/hash/XxHash.md new file mode 100644 index 0000000000..52f501cac2 --- /dev/null +++ b/content/en/functions/hash/XxHash.md @@ -0,0 +1,20 @@ +--- +title: hash.XxHash +description: Returns the 64-bit xxHash non-cryptographic hash of the given string. +categories: [] +keywords: [] +action: + aliases: [] + related: + - functions/hash/FNV32a + - functions/crypto/HMAC + - functions/crypto/MD5 + - functions/crypto/SHA1 + - functions/crypto/SHA256 + returnType: int + signatures: [hash.XxHash STRING] +--- + +```go-html-template +{{ hash.XxHash "Hello world" }} → c500b0c912b376d8 +``` diff --git a/content/en/functions/hash/_index.md b/content/en/functions/hash/_index.md new file mode 100644 index 0000000000..bf21c5b7b5 --- /dev/null +++ b/content/en/functions/hash/_index.md @@ -0,0 +1,12 @@ +--- +title: Hash functions +linkTitle: hash +description: Template functions to create non-cryptographic hashes. +categories: [] +keywords: [] +menu: + docs: + parent: functions +--- + +Use these functions to create non-cryptographic hashes.