web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB

  1. # crypto-random-string [![Build Status](https://travis-ci.org/sindresorhus/crypto-random-string.svg?branch=master)](https://travis-ci.org/sindresorhus/crypto-random-string)
  2. > Generate a [cryptographically strong](https://en.m.wikipedia.org/wiki/Strong_cryptography) random string
  3. Can be useful for creating an identifier, slug, salt, fixture, etc.
  4. ## Install
  5. ```
  6. $ npm install --save crypto-random-string
  7. ```
  8. ## Usage
  9. ```js
  10. const cryptoRandomString = require('crypto-random-string');
  11. cryptoRandomString(10);
  12. //=> '2cf05d94db'
  13. ```
  14. ## API
  15. ### cryptoRandomString(length)
  16. #### length
  17. Type: `number`
  18. Length of the returned string.
  19. ## Related
  20. - [random-int](https://github.com/sindresorhus/random-int) - Generate a random integer
  21. - [random-float](https://github.com/sindresorhus/random-float) - Generate a random float
  22. - [random-item](https://github.com/sindresorhus/random-item) - Get a random item from an array
  23. - [random-boolean](https://github.com/arthurvr/random-boolean) - Get a random boolean
  24. - [random-obj-key](https://github.com/sindresorhus/random-obj-key) - Get a random key from an object
  25. - [random-obj-prop](https://github.com/sindresorhus/random-obj-prop) - Get a random property from an object
  26. - [unique-random](https://github.com/sindresorhus/unique-random) - Generate random numbers that are consecutively unique
  27. ## License
  28. MIT © [Sindre Sorhus](https://sindresorhus.com)