VictorTaelin/Bitspeak

82

stars

25

commits

JavaScript

primary language

Dec 8, 2019

updated

README

Bitspeak

Converts hex strings to pronounceable words. This may be a good format to print small identifiers or data that needs to be pronounced. For example, if we display the 0x44042f as Base64, it may become something like hS_$, which is pronounced as "height uppercase ess underline dollar sign". With Bitspeak, the same hex becomes "kupakare", which is much easier to say. That's all...

Usage

const bs = require("bitspeak");

console.log(bs.hexToBitspeak6("476ffe")); // "kunizezi"
console.log(bs.bitspeak6ToHex("kunizezi")); // "476ffe"

Examples

Bitspeak has two versions, 6-bit and 8-bit per syllable. The 6-bit version is more accurate since syllables don't get mixed up, but the 8-bit one is more round since it matches 1 byte per syllable.

NumHexBs6Bs8
16261014f81f96zipuzigizunbowven
445751944042fkupakarekuputow
260949427d156tuzubugitinyegen
152924617559ebunugijibinganvaw
14570023de5227nevutaveyawgitin
27539982a05cetifageditaipanmaw
5519699543953gupevukegudongo
38705003b0f24dimazavadeipowtu
13033781c6e135muribanumensedan
15789528f0edd8zadinexazasuiyun
14701023e42pafesupipidawki
73134316f9817xesufagechowvunbin
221318621c542tajagupitemanki
214575020bdd6tatenegitaruiyen
40716403e20d8defipexadawtayun
19743521e2050befipukabawtaga
95129329127e4vakijevavetinsu
451780044efa8kudizilakusowlun
12793805c337cdmamejedumodinmui
864985483fc7efazemuzifozoijaw
14233703d93067nikepuveyondachin
29736852d5ff5teguzenutuigowzan
529789350d6e5gaduxevugayensan
9990788987284vibetibavunjifu

Pronounce

On the 6-bit version, consonants are picked to maintain an unique map between the pronounce and the writing. Consonants like x should be understood as sh from shower, not x from dex, and consonants like g should be read as in game, even when they're followed by an i or e. Here is a table with the proper sounds:

consontantsounds as in
ppool
bbad
ttape
ddice
kking
ggame
xshower
jjoker
ffire
vvoid
lletter
rrat
mmask
nninja
ssun
zzebra

Similarly, each syllable must be pronounced in isolation: kupakare is coo - pa - ka - re, not coo - pa - care.

Specification

Bitspeak has two flavors, 6-bit and 8-bit per syllable. They use the following tables:

6-Bit

// 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

8-bit

// Consonants:

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

// Vowels:

0000 -> a
0001 -> e
0010 -> i
0011 -> o
0100 -> u
0101 -> an
0110 -> en
0111 -> in
1000 -> un
1001 -> on
1010 -> ai
1011 -> ei
1100 -> oi
1101 -> ui
1110 -> aw
1111 -> ow

Why?

For when you have to type, vocalize or memorize bytes for whatever reason. For example, typing a shortened URL in a phone, manually accessing an uuid in a database, or memorizing a crypto private key. Sure, that should not happen, but if it does, Bitspeak is supposed to make the process slightly less painful, as it is arguably easier to write "kupakare" correctly than "hS_$" or "44042f".

  1. Typing special characters and uppercase letters in a phone is painful.

  2. The pronounce is shorter (kupakare vs heightuppercaseessunderlinedollar vs fourfourzerofourtwoeff).

  3. It is gentler to human menory as it has less traps ("was it uppercase or lowercase?").

We're considering using something like that for displaying the unique identifiers of Formality files, a new programming and proof language.

Relevant XKCD

Contributors

VictorTaelin

24 commits

aadnk

1 commits

VictorTaelin/Bitspeak

82

stars

25

commits

JavaScript

primary language

Dec 8, 2019

updated

README

Bitspeak

Converts hex strings to pronounceable words. This may be a good format to print small identifiers or data that needs to be pronounced. For example, if we display the 0x44042f as Base64, it may become something like hS_$, which is pronounced as "height uppercase ess underline dollar sign". With Bitspeak, the same hex becomes "kupakare", which is much easier to say. That's all...

Usage

const bs = require("bitspeak");

console.log(bs.hexToBitspeak6("476ffe")); // "kunizezi"
console.log(bs.bitspeak6ToHex("kunizezi")); // "476ffe"

Examples

Bitspeak has two versions, 6-bit and 8-bit per syllable. The 6-bit version is more accurate since syllables don't get mixed up, but the 8-bit one is more round since it matches 1 byte per syllable.

NumHexBs6Bs8
16261014f81f96zipuzigizunbowven
445751944042fkupakarekuputow
260949427d156tuzubugitinyegen
152924617559ebunugijibinganvaw
14570023de5227nevutaveyawgitin
27539982a05cetifageditaipanmaw
5519699543953gupevukegudongo
38705003b0f24dimazavadeipowtu
13033781c6e135muribanumensedan
15789528f0edd8zadinexazasuiyun
14701023e42pafesupipidawki
73134316f9817xesufagechowvunbin
221318621c542tajagupitemanki
214575020bdd6tatenegitaruiyen
40716403e20d8defipexadawtayun
19743521e2050befipukabawtaga
95129329127e4vakijevavetinsu
451780044efa8kudizilakusowlun
12793805c337cdmamejedumodinmui
864985483fc7efazemuzifozoijaw
14233703d93067nikepuveyondachin
29736852d5ff5teguzenutuigowzan
529789350d6e5gaduxevugayensan
9990788987284vibetibavunjifu

Pronounce

On the 6-bit version, consonants are picked to maintain an unique map between the pronounce and the writing. Consonants like x should be understood as sh from shower, not x from dex, and consonants like g should be read as in game, even when they're followed by an i or e. Here is a table with the proper sounds:

consontantsounds as in
ppool
bbad
ttape
ddice
kking
ggame
xshower
jjoker
ffire
vvoid
lletter
rrat
mmask
nninja
ssun
zzebra

Similarly, each syllable must be pronounced in isolation: kupakare is coo - pa - ka - re, not coo - pa - care.

Specification

Bitspeak has two flavors, 6-bit and 8-bit per syllable. They use the following tables:

6-Bit

// 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

8-bit

// Consonants:

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

// Vowels:

0000 -> a
0001 -> e
0010 -> i
0011 -> o
0100 -> u
0101 -> an
0110 -> en
0111 -> in
1000 -> un
1001 -> on
1010 -> ai
1011 -> ei
1100 -> oi
1101 -> ui
1110 -> aw
1111 -> ow

Why?

For when you have to type, vocalize or memorize bytes for whatever reason. For example, typing a shortened URL in a phone, manually accessing an uuid in a database, or memorizing a crypto private key. Sure, that should not happen, but if it does, Bitspeak is supposed to make the process slightly less painful, as it is arguably easier to write "kupakare" correctly than "hS_$" or "44042f".

  1. Typing special characters and uppercase letters in a phone is painful.

  2. The pronounce is shorter (kupakare vs heightuppercaseessunderlinedollar vs fourfourzerofourtwoeff).

  3. It is gentler to human menory as it has less traps ("was it uppercase or lowercase?").

We're considering using something like that for displaying the unique identifiers of Formality files, a new programming and proof language.

Relevant XKCD

Contributors

VictorTaelin

24 commits

aadnk

1 commits

Languages

JavaScript

100.0%