Remove buffer dependency.
This commit is contained in:
@@ -3,9 +3,9 @@ import { encrypt } from '../src/encrypt'
|
||||
|
||||
test('Test nonce generation by public encrypt function.', () => {
|
||||
// Given
|
||||
const message = Buffer.from('Hello, World! This is a test message.')
|
||||
const associatedData = Buffer.from('Some associated data.')
|
||||
const key = Buffer.from('\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f')
|
||||
const message = new TextEncoder().encode('Hello, World! This is a test message.')
|
||||
const associatedData = new TextEncoder().encode('Some associated data.')
|
||||
const key = Uint8Array.from([0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f])
|
||||
|
||||
// When
|
||||
const ciphertext = encrypt(message, associatedData, key)
|
||||
|
||||
Reference in New Issue
Block a user