bsqsq

b'' for short, bsqsq converts hexstrings to python bytearray notation

Usage no npm install needed!

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

README

bsqsq

b'' for short, bsqsq converts hexstrings to python bytearray notation

Usage

import bsqsq from "bsqsq";
const hexString = "e9eed8dc39332032dc22e5d6e86332c50327ba23";
const byteArray = bsqsq(hexString); // becomes b'\xe9\xee\xd8\xdc93 2\xdc"\xe5\xd6\xe8c2\xc5\x03\'\xba#'
const revByteArray = bsqsq(hexString, true); // becomes b'#\xba\'\x03\xc52c\xe8\xd6\xe5"\xdc2 39\xdc\xd8\xee\xe9'