(text: string, field: string)
| 68 | const toBase64 = (bytes: Uint8Array): string => Base64.encode(bytes) |
| 69 | |
| 70 | const fromBase64 = (text: string, field: string): Uint8Array => { |
| 71 | const decoded = Base64.decode(text) |
| 72 | if (Result.isFailure(decoded)) { |
| 73 | return fail(`Invalid base64 in SCRAM attribute "${field}"`) |
| 74 | } |
| 75 | return decoded.success |
| 76 | } |
| 77 | |
| 78 | const decodeUtf8 = (bytes: Uint8Array, what: string): string => { |
| 79 | try { |
no test coverage detected