node-red-contrib-trng
Version:
A Node-RED module for generating random data using a hybrid approach.
56 lines (45 loc) • 1.57 kB
HTML
<!--
Copyright 2023 Bufferstack.IO Analytics Technology LLP, Pune.
Licensed under the GNU General Public License, Version 3.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.gnu.org/licenses/gpl-3.0.html
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/javascript">
RED.nodes.registerType("trng", {
category: "function",
color: "#a6bbcf",
defaults: {
name: { value: "" },
},
inputs: 1,
outputs: 1,
icon: "font-awesome/fa-random",
label: function () {
return this.name || "trng";
},
});
</script>
<script type="text/x-red" data-template-name="trng">
<div class="form-row">
<label for="node-input-name">
<i class="fa fa-tag"></i> Name
</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="trng">
<p>
This node generates a random number using a hybrid approach that combines
the JavaScript crypto.getRandomValues() function with the current time.
</p>
<p>
The input message will trigger the generation of a random number, and the
output message will contain the generated random number in the payload.
</p>
</script>