You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

liamloads-reverse-endianness

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

liamloads-reverse-endianness

Reverse hexadecimal string endianness with JavaScript.

1.0.2
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

About

Description

This is a fast algorithm for reversing byte order endianness of hexadecimal numbers without regular expressions.

It's written in JavaScript and outputs a case-insensitive, even-number hexadecimal string in reverse byte order.

A complete line-by-line algorithm code explanation is coming soon.

License

The Unlicense

Installation

Browser

git clone https://github.com/liamloads/javascript-reverse-endianness.git
<script src="liamloads-reverse-endianness.js" type="text/javascript"></script>

Node.js

npm install liamloads-reverse-endianness
const liamloadsReverseEndianness = require('liamloads-reverse-endianness');

Usage

Details

The return value is a string of the argument in reverse byte order.

If the argument isn't a hexadecimal number or if the UTF-16 code unit length exceeds 999999999, the return value is false.

Examples


console.log(liamloadsReverseEndianness('123456789'));
// '8967452301'

console.log(liamloadsReverseEndianness('0123456789'));
// '8967452301'

console.log(liamloadsReverseEndianness('abcdef'));
// 'efcdab'

console.log(liamloadsReverseEndianness('ABCDEF'));
// 'EFCDAB'

console.log(liamloadsReverseEndianness('abcdef '));
// false

console.log(liamloadsReverseEndianness('abcdefg'));
// false

Keywords

algorithm

FAQs

Package last updated on 25 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.