forked from gtm-templates-simo-ahava/sha256-hasher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.tpl
76 lines (57 loc) · 1.38 KB
/
template.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
___TERMS_OF_SERVICE___
By creating or modifying this file you agree to Google Tag Manager's Community
Template Gallery Developer Terms of Service available at
https://developers.google.com/tag-manager/gallery-tos (or such other URL as
Google may provide), as modified from time to time.
___INFO___
{
"type": "MACRO",
"id": "cvt_temp_public_id",
"version": 1,
"securityGroups": [],
"categories": ["UTILITY"],
"__wm": "VGVtcGxhdGUtQXV0aG9yX3NoYTI1Nkhhc2hlci1TaW1vLUFoYXZh",
"displayName": "sha256 Hasher",
"description": "Use this variable to hash any input value with SHA256.",
"containerContexts": [
"SERVER"
]
}
___TEMPLATE_PARAMETERS___
[
{
"type": "TEXT",
"name": "input",
"displayName": "Value to hash",
"simpleValueType": true,
"valueValidators": [
{
"type": "NON_EMPTY"
}
]
},
{
"type": "RADIO",
"name": "encoding",
"displayName": "Output encoding",
"radioItems": [
{
"value": "base64",
"displayValue": "base64"
},
{
"value": "hex",
"displayValue": "hex"
}
],
"simpleValueType": true,
"defaultValue": "base64"
}
]
___SANDBOXED_JS_FOR_SERVER___
const sha256Sync = require('sha256Sync');
return sha256Sync(data.input, {outputEncoding: data.encoding});
___TESTS___
scenarios: []
___NOTES___
Created on 11/02/2021, 10:52:38