1.0.3 • Published 6 months ago
random-base-string v1.0.3
@ksr/random-base-string
A utility function that generates a random string in a given numeric base (e.g., hexadecimal, binary) with customizable length.
Installation
You can install it via JSR:
npm i random-base-string
Usage Example
import { randomBaseString as _rBs } from '@ksr/random-base-string';
// Generate a random hex string with length 8
const hexString = _rBs(16, 8);
console.log(hexString);
// Generate a random binary string with length 12
const binaryString = _rBs(2, 12);
console.log(binaryString);