1.0.5 • Published 4 years ago

isstrhex v1.0.5

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

isStrHex

Simple way to detect if a string is a hexadecimal value (A-Fa-f0-9) This is a very simple code, that would help with validation of strings, And is used inside another of my packages. Main reason of the creation for me was to validate data input on Ethereum transactions in case the user added a non-hex character inside any of the values. but can be used for pretty much anything else (as long as a simple hex validation is needed)

NPM and version

npm version

Install

Install using NPM with the following command:

npm i isstrhex

Usage

Here are a few examples that can be used:

const isHex = require("isstrhex");
isHex("F"); // Returns true
isHex("Fae4039"); // Returns true
isHex("kli093"); // Returns false
isHex("🌟@#$"); // Returns false

Test

Run npm test for more tests.

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago