speakeasy icon indicating copy to clipboard operation
speakeasy copied to clipboard

generateSecret length param not working properly

Open tbell511 opened this issue 3 years ago • 2 comments

  const secret = speakeasy.generateSecret({
    issuer: 'My site',
    length: 32,
  });
  
  // secret -> HBWSKVZDKRPEU3T3G5HFI5CIKRNC4WSMN47T43SDNZKXGRCSNE4A

outputs a secret that has a length of 52

Adjusting the length down to 20 outputs a secret with a length of 32

  const secret = speakeasy.generateSecret({
    issuer: 'My site',
    length: 20,
  });
  
  // secret -> JBRHUZ2UPJ3X23LOEZKCMRDXER4VEVDF

tbell511 avatar Jan 03 '23 14:01 tbell511

Hi!

Thanks for the report, I think this bug comes from the original library and fixing it might break existing code.

Levminer avatar Jan 16 '23 13:01 Levminer

introduce a new parameter called "realLength"?

hkjeffchan avatar Apr 17 '24 07:04 hkjeffchan