1
0
Fork 0
mirror of https://github.com/CorentinTh/it-tools.git synced 2025-08-04 04:55:18 +02:00

feat(hash-text): digest base selector (#254)

This commit is contained in:
Corentin THOMASSET 2022-08-03 17:16:03 +02:00 committed by GitHub
parent fad4833ca2
commit 422b6eb05a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 62 additions and 7 deletions

View file

@ -0,0 +1,15 @@
import { describe, expect, it } from 'vitest';
import { convertHexToBin } from './hash-text.service';
describe('hash text', () => {
describe('convertHexToBin', () => {
it('convert hex to bin', () => {
expect(convertHexToBin('')).toEqual('');
expect(convertHexToBin('FF')).toEqual('11111111');
expect(convertHexToBin('F'.repeat(200))).toEqual('1111'.repeat(200));
expect(convertHexToBin('2123006AD00F694CE120')).toEqual(
'00100001001000110000000001101010110100000000111101101001010011001110000100100000',
);
});
});
});