Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1import crypto from 'crypto'2 3import { urlAlphabet } from '../url-alphabet/index.js'4 5let random = bytes =>6 new Promise((resolve, reject) => {7 crypto.randomFill(Buffer.allocUnsafe(bytes), (err, buf) => {8 if (err) {9 reject(err)10 } else {11 resolve(buf)12 }13 })14 })15 16let customAlphabet = (alphabet, defaultSize = 21) => {17 let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 118 19 20 let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)21 22 let tick = (id, size = defaultSize) =>23 random(step).then(bytes => {24 let i = step25 while (i--) {26 id += alphabet[bytes[i] & mask] || ''27 if (id.length >= size) return id28 }29 return tick(id, size)30 })31 32 return (size = defaultSize) => {33 if (size <= 0) return Promise.resolve('')34 return tick('', size)35 }36}37 38let nanoid = (size = 21) =>39 random((size |= 0)).then(bytes => {40 let id = ''41 while (size--) {42 id += urlAlphabet[bytes[size] & 63]43 }44 return id45 })46 47export { nanoid, customAlphabet, random }48 