(version: number, id: string, encryptionKey: Uint8Array)
| 4 | * To share links easily, we encode the id, where the data is stored in redis, together with the secret encryption key. |
| 5 | */ |
| 6 | export function encodeCompositeKey(version: number, id: string, encryptionKey: Uint8Array): string { |
| 7 | if (version < 0 || version > 255) { |
| 8 | throw new Error("Version must fit in a byte"); |
| 9 | } |
| 10 | const compositeKey = new Uint8Array([version, ...fromBase58(id), ...encryptionKey]); |
| 11 | |
| 12 | return toBase58(compositeKey); |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * To share links easily, we encode the id, where the data is stored in redis, together with the secret encryption key. |
no test coverage detected