Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(vrl): add crc vrl function docs #21924

Merged
merged 11 commits into from
Jan 11, 2025
3 changes: 2 additions & 1 deletion website/cue/reference/remap/functions.cue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ remap: {
pure: bool | *true
}

#FunctionCategory: "Array" | "Codec" | "Coerce" | "Convert" | "Debug" | "Enrichment" | "Enumerate" | "Event" | "Path" | "Cryptography" | "IP" | "Number" | "Object" | "Parse" | "Random" | "String" | "System" | "Timestamp" | "Type"
#FunctionCategory: "Array" | "Codec" | "Coerce" | "Convert" | "Debug" | "Enrichment" | "Enumerate" | "Event" | "Path" | "Cryptography" | "IP" | "Number" | "Object" | "Parse" | "Random" | "String" | "System" | "Timestamp" | "Type" | "Checksum"

// A helper array for generating docs. At some point, we should generate this from the
// #FunctionCategory enum if CUE adds support for that.
Expand All @@ -52,6 +52,7 @@ remap: {
"System",
"Timestamp",
"Type",
"Checksum",
]

functions: [Name=string]: #Function & {
Expand Down
29 changes: 29 additions & 0 deletions website/cue/reference/remap/functions/crc32.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package metadata

remap: functions: crc32: {
category: "Checksum"
description: """
Calculates a CRC32 of the string,`value`.
"""

arguments: [
{
name: "value"
description: "The string to calculate the checksum for."
required: true
type: ["string"]
},
]
internal_failure_reasons: []
return: types: ["string"]

examples: [
{
title: "Create CRC32 checksum"
source: #"""
crc32("foo")
"""#
return: "8c736521"
},
]
}
Loading