(str: string)
| 144 | * @returns Uint8Array of the string's bytes |
| 145 | */ |
| 146 | export function stringToBytes(str: string) { |
| 147 | return new Uint8Array(str.split("").map(c => c.charCodeAt(0))); |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * Create a Uint8Array from hex string (for creating test data). |
no test coverage detected