https://github.com/fabiospampinato/hex-to-uint8
The fastest function to convert a hexadecimal string to a Uint8Array.
https://github.com/fabiospampinato/hex-to-uint8
buffer conversion convert hex hexadecimal uint8 uint8array
Last synced: 7 months ago
JSON representation
The fastest function to convert a hexadecimal string to a Uint8Array.
- Host: GitHub
- URL: https://github.com/fabiospampinato/hex-to-uint8
- Owner: fabiospampinato
- License: mit
- Created: 2023-08-07T10:55:37.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-24T16:28:49.000Z (over 1 year ago)
- Last Synced: 2024-05-01T12:39:14.709Z (about 1 year ago)
- Topics: buffer, conversion, convert, hex, hexadecimal, uint8, uint8array
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Hex To Uint8
The fastest function to convert a hexadecimal string to a Uint8Array.
## Install
```sh
npm install --save hex-to-uint8
```## Usage
```ts
import toUint8 from 'hex-to-uint8';const hex = '48656c6c6f2c20776f726c6421';
const uint8 = toUint8 ( hex ); // => Uint8Array(13) [ 72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33 ]
```## License
MIT © Fabio Spampinato