Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions doc/_stdlib_gen/stdlib-content.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,58 @@ local html = import 'html.libsonnet';
Encodes the given value into an MD5 string.
|||,
},
{
name: 'sha1',
params: ['s'],
availableSince: 'upcoming',
description: [
html.p({}, |||
Encodes the given value into an SHA1 string.
|||),
html.p({}, |||
This function is only available in Go version of jsonnet.
|||),
],
},
{
name: 'sha256',
params: ['s'],
availableSince: 'upcoming',
description: [
html.p({}, |||
Encodes the given value into an SHA256 string.
|||),
html.p({}, |||
This function is only available in Go version of jsonnet.
|||),
],
},
{
name: 'sha512',
params: ['s'],
availableSince: 'upcoming',
description: [
html.p({}, |||
Encodes the given value into an SHA512 string.
|||),
html.p({}, |||
This function is only available in Go version of jsonnet.
|||),
],
},
{
name: 'sha3',
params: ['s'],
availableSince: 'upcoming',
description: [
html.p({}, |||
Encodes the given value into an SHA3 string.
|||),
html.p({}, |||
This function is only available in Go version of jsonnet.
|||),
],
},
],
},
{
Expand Down
7 changes: 7 additions & 0 deletions stdlib/std.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ limitations under the License.
local std = self,
local id = function(x) x,

local go_only_function = error 'This function is only supported in go version of jsonnet. See https://github.com/google/go-jsonnet',

isString(v):: std.type(v) == 'string',
isNumber(v):: std.type(v) == 'number',
isBoolean(v):: std.type(v) == 'boolean',
Expand Down Expand Up @@ -1772,5 +1774,10 @@ limitations under the License.
if k != key
},

sha1(str):: go_only_function,
sha256(str):: go_only_function,
sha512(str):: go_only_function,
sha3(str):: go_only_function,

trim(str):: std.stripChars(str, ' \t\n\f\r\u0085\u00A0'),
}