Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Add IE11 support
- const crypto = window.crypto || window.msCrypto
- const generatePassword = (length = 10) => {
- const buffer = new Uint8Array(12)
- crypto.getRandomValues(buffer)
- return btoa(String.fromCharCode.apply(null, buffer)).substr(0, length)
- }
- export default generatePassword
Add Comment
Please, Sign In to add comment