Last active
July 11, 2019 15:03
-
-
Save AshUK/789621da7b5107eb67fa1faf648a9523 to your computer and use it in GitHub Desktop.
hex string to padded hex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const toHex = text => { | |
const arr = text.match(/.{1,2}/g) | |
return `0x${arr.join(', 0x')}` | |
} | |
const stringValue = "69bff87ecc81b87ba4a6cfc9ef827303fe60e2adafe7627102fd744b490b2af1" | |
console.log(toHex(stringValue)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment