(length)
| 6 | import {SymEncryptedSessionKeyPacket, PacketList, SymEncryptedIntegrityProtectedDataPacket, Message, enums} from 'openpgp'; |
| 7 | |
| 8 | export function randomString(length) { |
| 9 | let result = ''; |
| 10 | const base = 32; |
| 11 | const buf = new Uint8Array(length); |
| 12 | crypto.getRandomValues(buf); |
| 13 | for (let i = 0; i < buf.length; i++) { |
| 14 | result += (buf[i] % base).toString(base); |
| 15 | } |
| 16 | return result; |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * Encrypt the message symmetrically using a passphrase. |
no outgoing calls
no test coverage detected