• Generate a secure random character string.

    Parameters

    • size: number

      Length of the generated secure random string

    Returns Buffer

    Example


    import * as crypto from 'crypto';
    import * as buffer from 'buffer';

    let rand = crypto.randomBytes(32);
    console.log(rand.toString(buffer.Encoding.Base64));