<commit_before>/**
 * Dependencies
 */
const crypto = require('webcrypto')

/**
 * Nonce
 */
class Nonce {

  /**
   * generate
   *
   * @description
   * Generate a base64url encoded SHA-256 hashed random nonce of a given length.
   *
   * @param {Number} nonce
   * @returns {Promise}
   */
  static generate (length) {
    let random = crypto.getRandomValues(new Uint32Array(length))
    return crypto.subtle.digest('SHA-256', random).then(hash => base64url(hex(hash)))
  }

  /**
   * verify
   */
  verify () {}
}

/**
 * Export
 */
export default Nonce
<commit_msg>refactor(Nonce): module.exports syntax<commit_after>/**
 * Dependencies
 */
const crypto = require('webcrypto')

/**
 * Nonce
 */
class Nonce {

  /**
   * generate
   *
   * @description
   * Generate a base64url encoded SHA-256 hashed random nonce of a given length.
   *
   * @param {Number} nonce
   * @returns {Promise}
   */
  static generate (length) {
    let random = crypto.getRandomValues(new Uint32Array(length))
    return crypto.subtle.digest('SHA-256', random).then(hash => base64url(hex(hash)))
  }

  /**
   * verify
   */
  verify () {}
}

/**
 * Export
 */
module.exports = Nonce

{'fraction_non_alphanumeric': 0.1520068317677199, 'fraction_numerical': 0.02049530315969257, 'mean_word_length': 2.893687707641196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5898658', 'n_tokens_mistral': 412, 'n_tokens_neox': 387, 'n_words': 89}