import { getRandomBytes } from './bytes.js';
import { CODE } from '@termsurf/tone-code';
export function getRandomId(n) {
    const value = [];
    const bn = Math.ceil(n / 2);
    const bytes = getRandomBytes(Math.ceil(n / 2));
    for (var i = 0; i < bn; i++) {
        const byte = bytes[i];
        const a = (byte >> 0) & 0xf;
        const b = (byte >> 4) & 0xf;
        const x = CODE[a];
        const y = CODE[b];
        value.push(x, y);
    }
    return value.join('');
}
//# sourceMappingURL=id.js.map