mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-25 17:26:15 -04:00
refactor(otp-generator): coerce lowercase secret characters to uppercase
This commit is contained in:
parent
f3b1863f09
commit
7c40539ef9
3 changed files with 7 additions and 2 deletions
|
@ -20,12 +20,16 @@ describe('otp functions', () => {
|
|||
expect(hexToBytes('0102030405060708090a0b0c0d0e0f')).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
|
||||
});
|
||||
});
|
||||
describe('base32tohex', () => {
|
||||
describe('base32toHex', () => {
|
||||
it('convert a base32 to hex string', () => {
|
||||
expect(base32toHex('ABCDEF')).to.eql('00443205');
|
||||
expect(base32toHex('7777')).to.eql('ffff0f');
|
||||
expect(base32toHex('JBSWY3DPEHPK3PXP')).to.eql('48656c6c6f21deadbeef');
|
||||
});
|
||||
|
||||
it('case does not matter', () => {
|
||||
expect(base32toHex('ABC')).to.eql(base32toHex('abc'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('generateHOTP', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue