15.304.0 • Published 1 year ago

@angular-ru/stream v15.304.0

Weekly downloads
32
License
MIT
Repository
github
Last release
1 year ago

@angular-ru/stream

  • compress, decompress, arrayBufferToBase64, base64ToArrayBuffer
import { compress, arrayBufferToBase64, base64ToArrayBuffer, decompress } from '@angular-ru/stream';

const base64: string = 'eJzLSM3JyVcozy/KSQEAGgsEXQ==';

it('compress', async () => {
    const buffer: ArrayBuffer = await compress('hello world');
    const result: string = arrayBufferToBase64(buffer);
    expect(result).toEqual(base64);
});

it('decompress', async () => {
    const buffer: ArrayBuffer = base64ToArrayBuffer(base64);
    const result: string = await decompress(buffer);
    expect(result).toEqual('hello world');
});

@angular-ru/stream/jwt

  • toBase64
import { decodeJwt, toBase64 } from '@angular-ru/stream/jwt';

it('toBase64', () => {
    expect(toBase64({ login: 'username', password: 'password' })).toEqual(
        'eyJsb2dpbiI6InVzZXJuYW1lIiwicGFzc3dvcmQiOiJwYXNzd29yZCJ9'
    );
});

/**
 * simple algorithm
 * const token = 'xxxxxxxxx.XXXXXXXX.xxxxxxxx'
 * const [headerEncoded, payloadEncoded, signature] = token.split('.')
 */
it('decodeJwt', () => {
    expect(decodeJwt(jwtToken)).toEqual(decodeModel);
});
15.304.0

1 year ago

15.303.0

1 year ago

15.302.1

1 year ago

15.301.3

1 year ago

15.301.0

1 year ago

15.276.2

1 year ago

15.253.0

1 year ago

15.249.1

1 year ago

15.235.0

1 year ago

15.237.0

1 year ago

15.231.1

1 year ago

15.239.0

1 year ago

15.224.0

1 year ago

15.159.1

2 years ago

15.138.0

2 years ago

15.138.1

2 years ago

15.129.0

2 years ago

15.81.0

2 years ago

15.79.0

2 years ago

15.3.0

2 years ago

15.0.1

2 years ago

15.0.0

2 years ago

14.64.2

2 years ago

14.46.0

2 years ago

14.42.1

2 years ago

14.41.4

2 years ago

14.41.2

2 years ago

14.41.3

2 years ago

14.41.1

2 years ago

14.39.1

2 years ago

14.37.1

2 years ago

14.36.1

2 years ago

14.33.0

2 years ago

14.32.2

2 years ago

14.32.1

2 years ago

14.30.1

2 years ago

14.30.0

2 years ago