@@ -180,6 +180,7 @@ the provided regular expression.
180
180
* [ ` stdlib::extname ` ] ( #stdlibextname ) : Returns the Extension (the Portion of Filename in Path starting from the
181
181
last Period).
182
182
* [ ` stdlib::ip_in_range ` ] ( #stdlibip_in_range ) : Returns true if the ipaddress is within the given CIDRs
183
+ * [ ` stdlib::sha256 ` ] ( #stdlibsha256 ) : Run a SHA256 calculation against a given value.
183
184
* [ ` stdlib::start_with ` ] ( #stdlibstart_with ) : Returns true if str starts with one of the prefixes given. Each of the prefixes should be a String.
184
185
* [ ` stdlib::str2resource ` ] ( #stdlibstr2resource ) : This converts a string to a puppet resource.
185
186
* [ ` stdlib::xml_encode ` ] ( #stdlibxml_encode ) : Encode strings for XML files
@@ -4918,6 +4919,66 @@ Data type: `Variant[String, Array]`
4918
4919
One CIDR or an array of CIDRs
4919
4920
defining the range(s) to check against
4920
4921
4922
+ ### <a name =" stdlibsha256 " ></a >` stdlib::sha256 `
4923
+
4924
+ Type: Ruby 4.x API
4925
+
4926
+ Run a SHA256 calculation against a given value.
4927
+
4928
+ #### Examples
4929
+
4930
+ ##### Check a simple string value
4931
+
4932
+ ``` puppet
4933
+ stdlib::sha256('my string') == '2f7e2089add0288a309abd71ffcc3b3567e2d4215e20e6ed3b74d6042f7ef8e5'
4934
+ ```
4935
+
4936
+ ##### Check a Sensitive datatype
4937
+
4938
+ ``` puppet
4939
+ stdlib::sha256(sensitive('my string')) == '2f7e2089add0288a309abd71ffcc3b3567e2d4215e20e6ed3b74d6042f7ef8e5'
4940
+ ```
4941
+
4942
+ ##### Check a number
4943
+
4944
+ ``` puppet
4945
+ stdlib::sha256(100.0) == '43b87f618caab482ebe4976c92bcd6ad308b48055f1c27b4c574f3e31d7683e0'
4946
+ stdlib::sha256(100.00000) == '43b87f618caab482ebe4976c92bcd6ad308b48055f1c27b4c574f3e31d7683e0'
4947
+ ```
4948
+
4949
+ #### ` stdlib::sha256(Variant[ScalarData, Sensitive[ScalarData], Binary, Sensitive[Binary]] $my_data) `
4950
+
4951
+ Run a SHA256 calculation against a given value.
4952
+
4953
+ Returns: ` String ` String
4954
+
4955
+ ##### Examples
4956
+
4957
+ ###### Check a simple string value
4958
+
4959
+ ``` puppet
4960
+ stdlib::sha256('my string') == '2f7e2089add0288a309abd71ffcc3b3567e2d4215e20e6ed3b74d6042f7ef8e5'
4961
+ ```
4962
+
4963
+ ###### Check a Sensitive datatype
4964
+
4965
+ ``` puppet
4966
+ stdlib::sha256(sensitive('my string')) == '2f7e2089add0288a309abd71ffcc3b3567e2d4215e20e6ed3b74d6042f7ef8e5'
4967
+ ```
4968
+
4969
+ ###### Check a number
4970
+
4971
+ ``` puppet
4972
+ stdlib::sha256(100.0) == '43b87f618caab482ebe4976c92bcd6ad308b48055f1c27b4c574f3e31d7683e0'
4973
+ stdlib::sha256(100.00000) == '43b87f618caab482ebe4976c92bcd6ad308b48055f1c27b4c574f3e31d7683e0'
4974
+ ```
4975
+
4976
+ ##### ` my_data `
4977
+
4978
+ Data type: ` Variant[ScalarData, Sensitive[ScalarData], Binary, Sensitive[Binary]] `
4979
+
4980
+ The ScalarData to evaluate
4981
+
4921
4982
### <a name =" stdlibstart_with " ></a >` stdlib::start_with `
4922
4983
4923
4984
Type: Ruby 4.x API
0 commit comments