(buffer: ArrayBuffer)
| 71 | |
| 72 | /** Decode an ArrayBuffer as a string. */ |
| 73 | export function arrayBuffer2String(buffer: ArrayBuffer): string { |
| 74 | if (buffer == null) { |
| 75 | throw new Error('Received null or undefind buffer'); |
| 76 | } |
| 77 | const buf = new Uint8Array(buffer); |
| 78 | return decodeURIComponent(escape(String.fromCharCode(...buf))); |
| 79 | } |
| 80 | |
| 81 | /** Generate a pseudo-random UID. */ |
| 82 | export function getUID(): string { |
no outgoing calls
no test coverage detected