WordArray: {
    create(words?: number[], sigBytes?: number): cryptojs.lib.WordArray;
    random(nBytes: number): cryptojs.lib.WordArray;
}

Type declaration

  • create:function
    • Initializes a newly created word array.

      Parameters

      • Optionalwords: number[]

        (Optional) An array of 32-bit words.

      • OptionalsigBytes: number

        (Optional) The number of significant bytes in the words.

      Returns cryptojs.lib.WordArray

      var wordArray = CryptoJS.lib.WordArray.create();
      var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
      var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
  • random:function
    • Creates a word array filled with random bytes.

      Parameters

      • nBytes: number

        The number of random bytes to generate.

      Returns cryptojs.lib.WordArray

      The random word array.

      var wordArray = CryptoJS.lib.WordArray.random(16);