jupystar
Version:
Converter from Jupyter notebook (ipynb) to Starboard notebook
14 lines • 411 B
JavaScript
function dec2hex(dec) {
return dec < 10
? '0' + String(dec)
: dec.toString(16);
}
export function generateUniqueId(length) {
const arr = new Uint8Array((length || 40) / 2);
crypto.getRandomValues(arr);
return Array.from(arr, dec2hex).join('');
}
export function generateUniqueCellId() {
return "cell-" + generateUniqueId(12);
}
//# sourceMappingURL=random.js.map