Socket
Book a DemoInstallSign in
Socket

desuhex

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

desuhex

DesuHex

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

DesuHex

Converts hex strings to Japanese-like words. This may be a good format to print for small identifies that need to be pronounciated. For example, if we store the 0x476ffe as Base64, it may become something like hS_$, which is pronounced as "height uppercase ess underline dollar sign". With desubits, the same hex becomes "kunizezi", which is much easier to say.

Usage

const ds = require("desuhex");

console.log(ds.hexToDesu("476ffe")); // "kunizezi"
console.log(ds.desuToHex("kunizezi")); // "476ffe"

Specification

DesuHex simply slices the hex into chunks of 6 bits (4 bits for a consonant, 2 bits for a vowel), pads, and uses the following conversion table:

// Consonants:

0000 -> p
0001 -> b
0010 -> t
0011 -> d
0100 -> k
0101 -> g
0110 -> x
0111 -> j
1000 -> f
1001 -> v
1010 -> l
1011 -> r
1100 -> m
1101 -> n
1110 -> s
1111 -> z

// Vowels:

00 -> a
01 -> u
10 -> i
11 -> e

FAQs

Package last updated on 16 Nov 2019

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