Skip to content

randomNumeric

Generates a random numeric string.

randomNumeric

Signature

typescript
function randomNumeric(length: number): string

Parameters

  • length - The length of the string to generate

Returns

Random string containing only digits.

Examples

typescript
import { randomNumeric } from 'strio'

randomNumeric(6)
// "123456" (random digits)

See Also

Released under the MIT License.