hexstringescaper

Escapes hex strings from "FF" format to "\xFF" hex equivalent

Usage no npm install needed!

<script type="module">
  import hexstringescaper from 'https://cdn.skypack.dev/hexstringescaper';
</script>

README

Hex String Escaper

Escapes hex strings from "FF" format to "\xFF" hex equivalent. Useful for dynamically creating hex values (such as for a rgb value).

Install

npm install hexstringescaper

Usage

var util = require("util"),
    HexStringEscaper = require("hexstringescaper"),
    hEsc = HexStringEscaper.escaper;

console.log(hEsc["1F"]); // logs a non-readable symbol 

console.log(util.format("This is escaped hex: %s", hEsc["FF"]));
This is escaped hex: ΓΏ