mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 17:14:33 +00:00
chore: replace uint8-to-base64 with native btoa/atob (#38579)
Replace the single-use `uint8-to-base64` dependency with native `btoa`/`atob`. The implementation is exactly identical. --------- Signed-off-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -113,6 +113,12 @@ test('encodeURLEncodedBase64, decodeURLEncodedBase64', () => {
|
||||
expect(encodeURLEncodedBase64(uint8array('a'))).toEqual('YQ'); // standard base64: "YQ=="
|
||||
expect(new Uint8Array(decodeURLEncodedBase64('YQ'))).toEqual(uint8array('a'));
|
||||
expect(new Uint8Array(decodeURLEncodedBase64('YQ=='))).toEqual(uint8array('a'));
|
||||
|
||||
expect(encodeURLEncodedBase64(uint8array('AA'))).toEqual('QUE'); // standard base64: "QUE="
|
||||
expect(new Uint8Array(decodeURLEncodedBase64('QUE'))).toEqual(uint8array('AA'));
|
||||
|
||||
const allBytes = Uint8Array.from({length: 256}, (_, i) => i);
|
||||
expect(new Uint8Array(decodeURLEncodedBase64(encodeURLEncodedBase64(allBytes)))).toEqual(allBytes);
|
||||
});
|
||||
|
||||
test('formatBytes', () => {
|
||||
|
||||
Reference in New Issue
Block a user