import { random } from "./random.ts" ; import { urlAlphabet } from "./urlAlphabet.ts" ; export const nanoid = ( size = 21 ) : string => { let id = "" ; const bytes = random ( size ) ; while ( size -- ) id += urlAlphabet [ bytes [ size ] & 63 ] ; return id ; } ;