// @flow
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')
const charsLength = chars.length

/* Some high number, usually 9-digit base-10. Map it to base-😎 */
const generateAlphabeticName = (code: number): string => {
  let name = ''
  let x

  for (x = code; x > charsLength; x = Math.floor(x / charsLength)) {
    name = chars[x % charsLength] + name
  }

  return chars[x % charsLength] + name
}

export default generateAlphabeticName

@@ -6,170 +6,411 @@
 low%0A
-const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')%0Aconst charsLength = chars.length%0A%0A/* Some high number, usually 9-digit base-10. Map
+/* eslint-disable no-bitwise */%0A%0A/* This is the %22capacity%22 of our alphabet i.e. 2x26 for all letters plus their capitalised%0A * counterparts */%0Aconst charsLength = 52%0A%0A/* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */%0Aconst getAlphabeticChar = (code: number): string =%3E%0A  String.fromCharCode(code + (code %3E 25 ? 39 : 97))%0A%0A/* input a number, usually a hash and convert
  it 
@@ -421,9 +421,10 @@
 ase-
-%F0%9F%98%8E
+52
  */%0A
@@ -507,16 +507,104 @@
  let x%0A%0A
+  /* get a char and divide by alphabet-length (bitwise zero for flooring the number) */%0A
   for (x
@@ -610,16 +610,20 @@
 x = code
+ %7C 0
 ; x %3E ch
@@ -641,18 +641,8 @@
 x = 
-Math.floor
 (x /
@@ -654,16 +654,20 @@
 sLength)
+ %7C 0
 ) %7B%0A    
@@ -673,22 +673,34 @@
  name = 
-chars%5B
+getAlphabeticChar(
 x %25 char
@@ -698,33 +698,33 @@
 (x %25 charsLength
-%5D
+)
  + name%0A  %7D%0A%0A  r
@@ -733,14 +733,26 @@
 urn 
-chars%5B
+getAlphabeticChar(
 x %25 
@@ -766,9 +766,9 @@
 ngth
-%5D
+)
  + n

Refactor generateAlphabeticName for shrinking bundlesize