[Question]
  [
Bibi-binary is a numeric system invented by [Boby Lapointe](https://en.wikipedia.org/wiki/Boby_Lapointe) in order to represent numbers in letters which pronunciation seems funny.
Your task is to convert decimal numbers into Bibi-binary!
## Conversion
A number is converted to base 16 (hexadecimal) and each character is replaced by its Bibi-binary name:
```
0 = HO
1 = HA
2 = HE
3 = HI
4 = BO
5 = BA
6 = BE
7 = BI
8 = KO
9 = KA
A = KE
B = KI
C = DO
D = DA
E = DE
F = DI
```
Let `N` be a positive integer (between 1 -> 2^31-1).
For every character in the hexadecimal representation of `N`, replace the character by its according Bibi-binary pair (the table above contains all the pairs).
## Example
* `N` = 156
* `H` = (hexadecimal representation of `N`) --> 9C
* 9 --> KA, C --> DO
Thus the output is KADO.
## Input & output
You will receive an positive 32-bit integer `N`, which you will have to turn into Bibi-binary.
You may (return, print, etc...) in any convenient format, **but the pairs have to be connected**! So `KA DO` wouldn't be okay, but `KADO` would.
Both, **lowercase and uppercase** are allowed.
## Rules
* No loopholes.
* This is code-golf, so the shortest code wins.
## Testcases
```
2048 -> KOHOHO
156 -> KADO
10000 -> HEBIHAHO
12 -> DO
```
  
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), ~~20~~ ~~18~~ 16 bytes
```
hv…Ã‚kdžM¨ÁâyHèJ
```
**Explanation**
```
h                     # convert input to hex
 v                    # for each
  …Ã‚kd               # string of the possible first Bibi-binary letters
       žM¨Á           # string of the possible second Bibi-binary letters
           â          # cartesian product to produce list of Bibi-binary pairs
            yH        # convert hex char to base 10
              è       # use this to index into the list
               J      # join
```
[Try it online!](http://05ab1e.tryitonline.net/#code=aHbigKbDg-KAmmtkxb5NwqjDgcOieUjDqEo&input=MTAwMDA)
Saved 2 bytes thanks to [Adnan](https://codegolf.stackexchange.com/users/34388/adnan)
[Answer]
# Python 2, 58 bytes
```
f=lambda n:(n>15and f(n/16)or"")+"HBKD"[n/4%4]+"OAEI"[n%4]
```
A recursive solution. [Try it on Ideone](http://ideone.com/pe889f).
[Answer]
# Python 2, ~~81~~ 76 bytes
```
lambda n:''.join('HBKD'[int(x,16)/4]+'OAEI'[int(x,16)%4]for x in hex(n)[2:])
```
Chooses the bibi-digit to represent each hex digit based on the patterns in the bibi-digits.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 17 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
b⁴d4ị"€“BKDH“AEIO
```
[Try it online!](http://jelly.tryitonline.net/#code=YuKBtGQ04buLIuKCrOKAnEJLREjigJxBRUlP&input=&args=MTU2) or [verify all test cases](http://jelly.tryitonline.net/#code=YuKBtGQ04buLIuKCrOKAnEJLREjigJxBRUlP4oCdCsOH4oKsWQ&input=&args=MjA0OCwgMTU2LCAxMDAwMCwgMTI).
### How it works
```
b⁴d4ị"€“BKDH“AEIO  Main link. Argument: n
b⁴                 Convert n to base 16.
  d4               Divmod 4; map each base-16 digit k to [k / 4, k % 4].
       “BKDH“AEIO  Yield ["BKDH", "AEIO"].
      €            For each quotient-remainder pair [q, r]:
    ị"               Yield "BKDH"[q] and "AEIO"[r] (1-based indexing).
```
[Answer]
## Javascript (ES6), ~~58~~ ~~53~~ 43 bytes
```
f=n=>n?f(n>>4)+'HBKD'[n/4&3]+'OAEI'[n&3]:''
```
*Saved 10 bytes (no support for n = 0 anymore)*
### Demo
```
var f=n=>n?f(n>>4)+'HBKD'[n/4&3]+'OAEI'[n&3]:''
console.log(f(2048));   // -> KOHOHO
console.log(f(156));    // -> KADO
console.log(f(10000));  // -> HEBIHAHO
console.log(f(12));     // -> DO
```
[Answer]
# Pyth, 28 bytes
```
L+?>b15y/b16k@*"HBKD""OAEI"b
```
Defines a function `y`. Basically the same algorithm as my [Python answer](https://codegolf.stackexchange.com/a/92123/34543).
Explanation:
```
L                            # Define a function, y, with an argument, b.
  ?>b15                      # If b > 15, then:
       y/b16                 # Call y with b / 16, else:
            k                # The empty string.
 +                           # Append with
              *"HBKD""OAEI"  # The Cartesian product of "HBKD" and "OAEI". Gives all the letter pairs in order
             @             b # Get the b'th number from that list. Because @ in Pyth is modular, we don't need to take b % 16.
```
[Try it here!](http://pyth.herokuapp.com/) (The extra two chars at the end is just to call the function)
[Answer]
# Ruby, ~~55~~ 51 bytes
A recursive anonymous function:
```
f=->i{(i>15?f[i/16]:'')+'HBKD'[i%16/4]+'OAEI'[i%4]}
```
Call it for example with `f[156]` and it returns `"KADO"`
[Answer]
# J, ~~35~~ 33 bytes
```
[:,(,/'HBKD',"0/'OAEI'){~16#.inv]
```
Generates the table of bibi-binary values for integers [0, 16), then converts the input *n* to a list of base 16 digits and selects the corresponding bibi-binary name for each hex digit.
Saved 2 bytes thanks to @randomra.
## Usage
```
   ,/'HBKD',"0/'OAEI'
HO
HA
HE
HI
BO
BA
BE
BI
KO
KA
KE
KI
DO
DA
DE
DI
```
This part generates a 16 x 2 array of characters for the bibi-binary name of each hex digit.
```
   f =: [:,(,/'HBKD',."0 1'OAEI'){~16#.inv]
   f 156
KADO
   f 2048
KOHOHO
```
## Explanation
```
,/'HBKD',"0/'OAEI'
  'HBKD'    'OAEI'  Constant char arrays
        ,"0/        Form the table of joining each char with the other
,/                  Join the rows of that table
[:,(,/'HBKD',."0 1'OAEI'){~16#.inv]  Input: n
                                  ]  Identity function, get n
                           16#.inv   Performs the inverse of converting an array of
                                     hex digits meaning it converts a value to a list of
                                     hex digits
   (,/'HBKD',."0 1'OAEI')            Create the bibi-binary names of each hex digit
                         {~          For each hex digit, select its bibi-binary name
[:,                                  Join the names to form a single string and return
```
[Answer]
# Perl, ~~52~~ 51 bytes
Includes +1 for `-p`
Run with the number on STDIN
```
bibi.pl <<< 156
```
`bibi.pl`:
```
#!/usr/bin/perl -p
1while$\=(<{H,B,K,D}{O,A,E,I}>)[$_%16].$\,$_>>=4}{
```
[Answer]
# PHP ,63 Bytes
contribution by @Titus Thank You 
```
for($n=$argv[1];$n;$n>>=4)$r=HBKD[$n/4&3].OAEI[$n&3].$r;echo$r;
```
72 Bytes works also with zero
```
do$r=OAEIHBKD[$t*4+($n=&$argv[1])%4].$r;while(($t=!$t)|$n=$n>>2);echo$r;
```
76 Bytes alternative Version
```
for($i=2*strlen(dechex($n=$argv[1]));$i;)echo HBKDOAEI[$i%2*4+$n/4**--$i%4];
```
[Answer]
# Ruby, ~~85~~ 83 bytes
```
->x{x.to_s(16).chars.map{|d|"HOHAHEHIBOBABEBIKOKAKEKIDODADEDI"[2*d.to_i(16),2]}*''}
```
Just a quick and simple solution without encoding the string.
[Answer]
# Pyth, 21 bytes
```
sm@*"HBKD""OAEI"djQ16
```
A program that takes input of an integer from STDIN and prints the result.
[Try it online](https://pyth.herokuapp.com/?code=sm%40%2a%22HBKD%22%22OAEI%22djQ16&test_suite=1&test_suite_input=2048%0A156%0A10000%0A12&debug=0)
**How it works**
```
sm@*"HBKD""OAEI"djQ16  Program. Input: Q
                 jQ16  Yield decimal digits of the base-16 representation of Q as a list
    "HBKD"              Possible first letters
          "OAEI"        Possible second letters
   *                    Cartesian product of those two strings
  @                     Index into the above
 m              d      Map that across the digits list
s                      Concatenate
                       Implicitly print
```
[Answer]
# PHP, 93 bytes
```
$a=HBKDOAEI;$h=dechex($argv[1]);while($h{$i}!=''|$c=hexdec($h{$i++}))echo$a{$c/4}.$a{4+$c%4};
```
This basically leverages the integrated hexadecimal functions and a little trick in the while statement to save on curly braces.
[Answer]
# Java, 224 bytes
```
class N{public static void main(String[]a){String x="0HO1HA2HE3HI4BO5BA6BE7BI8KO9KAaKEbKIcDOdDAeDEfDI";for(int c:Long.toHexString(Long.valueOf(a[0])).toCharArray()){c=x.indexOf(c)+1;System.out.print(x.substring(c++,++c));}}}
```
Using some lookup table trickery
Usage of Long type was to shave off a few bytes compared to Integer
[Answer]
## [CJam](http://sourceforge.net/projects/cjam/), 20 bytes
```
qiGb"HBKD""OAEI"m*f=
```
[Try it online!](http://cjam.tryitonline.net/#code=cU4ve1MvMD06UTsKClFpR2IiSEJLRCIiT0FFSSJtKmY9Cgpdbn0v&input=MjA0OCAtPiBLT0hPSE8KMTU2IC0-IEtBRE8KMTAwMDAgLT4gSEVCSUhBSE8KMTIgLT4gRE8) (As a linefeed-separated test suite.)
### Explanation
```
qi      e# Read input and convert to integer.
Gb      e# Get hexadecimal digits.
"HBKD"  e# Push this string.
"OAEI"  e# Push this string.
m*      e# Cartesian product, yields ["HO" "HA" "HE" "HI" "BO" ... "DE" "DI"].
f=      e# For each digit, select the corresponding syllable.
```
[Answer]
# [Dyalog APL](http://goo.gl/9KrKoM), 19 [bytes](http://meta.codegolf.stackexchange.com/a/9429/43319)
Requires `⎕IO←0` which is default on many systems.
```
∊(,'HBKD'∘.,'OAEI')[16⊥⍣¯1⊢⎕]
```
`∊` enlist (make completely flat)
`(`...
 `,` the raveled
 `'HBKD'∘.,'OAEI'` concatenation table (i.e. all combos)
`)[` indexed by...
 `16⊥⍣¯1` the inverse of base-16 to base 10 (i.e. base-10 to base 16) representation
 `⊢` of
 `⎕` the numeric input
`]`
[TryAPL online!](http://tryapl.org/?a=%u2395IO%u21900%20%u22C4%20f%u2190%7B%u220A%28%2C%27HBKD%27%u2218.%2C%27OAEI%27%29%5B16%u22A5%u2363%AF1%u22A2%u2375%5D%7D%20%u22C4%20f%A82048%20156%2010000%2012&run)
[Answer]
# Lua, 196 Bytes
```
function(n)s=""t={"H","B","K","D"}p={"O","A","E","I"}while n>0 do s=n%4 ..s n=math.floor(n/4)end s=("0"):rep(#s%2)..s o=nil return s:gsub(".",function(s)o=not o return o and t[s+1]or p[s+1]end)end
```
Lua is annoying for this sort of a task, as it doesn't per default contain a hex or binary conversion method. Most of the flesh is converting it to base 4. After that we force a 0 behind it if we need to using `s=("0"):rep(#s%2)`, then we using gsub replace all the didgets with with their BIBI counterpart.
[Answer]
# [Haskell](https://www.haskell.org/), 76 bytes
```
(until(\x->x<="HO"||x>="HP")(drop 2)`map`mapM id([1..8]>>["HBKD","OAEI"])!!)
```
[Try it online!](https://tio.run/##y0gszk7NyfmfZhvzX6M0ryQzRyOmQteuwsZWycNfqaamwg7ICFDS1Egpyi9QMNJMyE0sAGFfhcwUjWhDPT2LWDu7aCUPJ28XJR0lf0dXT6VYTUVFzf@5iZl5tgVFmXklKkDlCmkK0QY6hjpGBiYWOoamZjqGBkCgY2gU@/9fclpOYnrxf93kggIA "Haskell – Try It Online")
Since the input is guaranteed to fit in 32 bits, we can generate a list of all \$16^8 = 2^{32}\$ strings and index into it, after removing `HO` (zeroes) from the start.
(Haskell's Prelude has no good tools for base conversion, but Cartesian products are real easy with `mapM`.)
To strip superfluous `HO`s from the start of each string, we `drop 2` characters from the front `until` the string either *equals* `HO` (0), or does not start with `HO`.
The obvious way to write this is `x=="HO"||take 2x/="HO"`, but `x<="HO"||x>="HP"` is a little shorter.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 13 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
s"HBKD"ï"OAEI
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=cyJIQktEIu8iT0FFSQ&input=MTAwMDA)
Or, with string compression:
```
s`baki`ó rï
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=c2CXYmFrgmlg8yBy7w&input=MTAwMDA)
[Answer]
# [K (ngn/k)](https://bitbucket.org/ngn/k), ~~30~~ 27 bytes
```
,/(,/"HBKD",/:\:"OAEI")@16\
```
[Try it online!](https://tio.run/##y9bNS8/7/z/NSkdfQ0dfycPJ20VJR98qxkrJ39HVU0nTwdAs5n@aupGBiYWCoamZgqEBECgYGv0HAA "K (ngn/k) – Try It Online")
Quite similar to the J solution by @miles and the APL solution by @adám.
[Answer]
# [Haskell](https://www.haskell.org/), 50 bytes
```
(l!!)
l=[]:tail[x++[a,b]|x<-l,a<-"HBKD",b<-"OAEI"]
```
[Try it online!](https://tio.run/##y0gszk7NyfmfZhvzXyNHUVGTK8c2OtaqJDEzJ7pCWzs6UScptqbCRjdHJ9FGV8nDydtFSScJyPJ3dPVUiv2fm5iZp2CrUFCUmVeioKKQm1igkKYQbWRgYqGjYGhqBiQMgABIGcX@/5eclpOYXvxfN7mgAAA "Haskell – Try It Online")
Recursively defines the infinite list `l` of all encoded numbers starting from 0.
---
# [Haskell](https://www.haskell.org/), 54 bytes
```
f n=mapM id([1|i<-[0..8],16^i<=n]>>["HBKD","OAEI"])!!n
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P00hzzY3scBXITNFI9qwJtNGN9pAT88iVsfQLC7TxjYv1s4uWsnDydtFSUfJ39HVUylWU1Ex739uYmaegq1CQVFmXomCigLQBIU0hWgDHQVDHQUjIAnCpmZAtoGJBZBpAASx//8lp@Ukphf/100uKAAA "Haskell – Try It Online")
Based off of [Lynn's solution](https://codegolf.stackexchange.com/a/214538/20260). The new idea is to avoid leading "zeroes" (`HO`'s) by predicting the number of digits in advance and only generating that many copies for `mapM`. A number has one digit in base 16 for each number in `1,16,256,4096,...` that is no greater than it. This gives the empty string for zero, but we could change it to `HO` like this:
**56 bytes**
```
f n=mapM id(0:[1|i<-[1..8],16^i<=n]>>["HBKD","OAEI"])!!n
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P00hzzY3scBXITNFw8Aq2rAm00Y32lBPzyJWx9AsLtPGNi/Wzi5aycPJ20VJR8nf0dVTKVZTUTHvf25iZp6CrUJBUWZeiYKKAtAMhTSFaAMdBUMdBSMgCcKmZkC2gYkFkGkABLH//yWn5SSmF//XTS4oAAA "Haskell – Try It Online")
A variant where we compute the number of digits directly:
**60 bytes**
```
f n=mapM id([0..until(\i->16^i>n)(+1)0]>>["HBKD","OAEI"])!!n
```
[Try it online!](https://tio.run/##FYzBCsIwEAV/ZRs8NJiWRLR4aUBRUET8gJhCqEYX0yXY@vvG@GCGOb2nG1/3EFLyQO3g4hnwVhpZ1x@aMJRXrLRqOtTEy7ni0mpt2GF72jHBLpv9kVleFJQGhwQtxDfSBDPIP@DBSAFKwCL7z6rJLZfrnDLPpm/vg3uMqepj/AE "Haskell – Try It Online")
---
# [Haskell](https://www.haskell.org/), 54 bytes
```
f 0=""
f n=f(div n 16)++mapM id[cycle"HBKD","OAEI"]!!n
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P03BwFZJiStNIc82TSMls0whT8HQTFNbOzexwFchMyU6uTI5J1XJw8nbRUlHyd/R1VMpVlEx739uYmaegq1CQVFmXomCigJQtUKaQrSBjoKhjoIRkARhUzMg28DEAsg0AILY//@S03IS04v/6yYXFAAA "Haskell – Try It Online")
[Answer]
# [Chip](https://github.com/Phlarx/chip), 174 bytes
```
 z---.
!+ZZZ^~s
Axxx])~-vv/c
Ex]xx' ,x]/b
Bxxx])~^}~/d
Fx]xx'g*-}^a
Cxx])v]--/c
G]xx'>x~v/d
Dxx])x+-]/a
H]xx'`}--/b
 )x)-----'
Axx].zv~S
Bxx]+^'
Cxx]<
Dxx]<
E]v-'
F]<
G]<
H]'
```
[Try it online!](https://tio.run/##RVBNa8MwDL3rV2ilw81S2WynHkJhXZP2tsNuAYclabsGRmcaY7Sy@K9ndnaYQEK89/TZ1P15bGuLa7TH3sr23BnMMhT5ayFGvBGRhLu0LMvK9/DMzDrx5JxqIWfNLHDJWjWw@WOqwasDFBPz8UBDVcNLJJwmCiW7iK/ZuyDaRpxT0qqGfcTfh6BpABNOKJqI47S8Of8W2@u0ElOzbCrNINcuaIqQ7YLvtRjDzgDm2l3sCWf3csUznC/icfNT93lM8AeZD0hXJBNy9WWsivdOQZpvJPf/hPHx6Rc "Bash – Try It Online") TIO includes a Bash wrapper that converts an integer string to an actual 32-bit integer value.
The top half prints out the letters corresponding to the binary data, once the bottom half has detected that we've reached the interesting data (in other words, we skip leading zeroes. To print all leading zeroes, remove the second line that starts with `A` and down.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 206 bytes
```
#include<stdio.h>
#include<unistd.h>
int main(){int a=0;char c;while(read(0,&c,1)){a*=10;a+=c-'0';}c=8;while(c--)if(a&15<<c*4)break;if(c!=7)c++;while(c--)printf("%c%c","HBKD"[a>>c*4+2&3],"OAEI"[a>>c*4&3]);}
```
Uses as requested input, no check done on read return.
```
int a=0;char c;                                                                                                                                               // declares accumilator and input char
               while(read(0,&c,1)){a*=10;a+=c-'0';}                                                                                                           // read input in accumulator
                                                   c=8;while(c--)if(a&15<<c*4)break;if(c!=7)c++;                                                              // goto first not null byte
                                                                                                while(c--)printf("%c%c",                                      // print for each byte
                                                                                                                        "HBKD"[a>>c*4+2&3],                   // fetching right consonant
                                                                                                                                           "OAEI"[a>>c*4&3]); // fetching right vowel
```
[Try it online!](https://tio.run/##Tc3fCoIwFAbw@57CFuqmLmZ/KJgTioKiix4gulhHzZFZmNKF@OxrQUXn6uPH93GAngG0HqgSiiZJo0edqNswj3s/aUpl8E2qrK2rVCUm7TtKwTjksrKAP3NVpLhKZYJZ4EAQEtJKT4SMS18AdZnLOxDzTw8oJSrD0gmnUQTehJzM8sINQV/MCPj@X/FemV8ZRjbYgAK0We5W6CDj2Oz8kTM@Bmi/WG@/ZIDwTuuQmXsB "C (gcc) – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), 20 bytes
```
ṁ!ṙ1*"HBKD""OAEI"B16
```
[Try it online!](https://tio.run/##yygtzv7//@HORsWHO2caail5OHm7KCn5O7p6KjkZmv3//9/IwMQCAA "Husk – Try It Online")
Similiar to the APL answer.
# [Husk](https://github.com/barbuz/Husk), 22 bytes
```
ṁz!e"BKDH""AEIO"m‰4B16
```
[Try it online!](https://tio.run/##yygtzv7//@HOxirFVCUnbxcPJSVHV09/pdxHDRtMnAzN/v//b2RgYgEA "Husk – Try It Online")
Idea from Dennis' answer.
]