expect(await sha1('炎')).toBe('d56e09ae2421b2b8a0b5ee5fdceaed663c8c9472')
expect(await sha1('abcdedf')).not.toBe('abcdef')
})
it('encodeBaes64', async () => {
expect(await encodeBase64('hooooooooo')).toBe('aG9vb29vb29vbw==')
expect(await encodeBase64('炎')).toBe('54KO')
expect(await encodeBase64('abcdef')).not.toBe('abcdedf')
it('encodeBaes64', () => {
expect(encodeBase64('hooooooooo')).toBe('aG9vb29vb29vbw==')
expect(encodeBase64('炎')).toBe('54KO')
expect(encodeBase64('abcdef')).not.toBe('abcdedf')
expect(encodeBase64('')).toBe('')
expect(() => {
encodeBase64(null)
}).toThrow(TypeError)
})
it('decodeBaes64', async () => {
expect(await decodeBase64('aG9vb29vb29vbw==')).toBe('hooooooooo')
expect(await decodeBase64('54KO')).toBe('炎')
expect(await decodeBase64('abcdedf')).not.toBe('abcdef')
expect(decodeBase64('aG9vb29vb29vbw==')).toBe('hooooooooo')
expect(decodeBase64('54KO')).toBe('炎')
expect(decodeBase64('abcdedf')).not.toBe('abcdef')
expect(decodeBase64('')).toBe('')
expect(() => {
decodeBase64(null)
}).toThrowError(TypeError)
})
})