Skip to content

HMAC secret length requirement #242

Answered by panva
lagden asked this question in Q&A
Aug 13, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Yes it is possible if you pad the secret with 0x00 to the required length. Nevertheless I only suggest to do so for migration purposes as you generate a new secret that follows the requirements.

const secret = Buffer.alloc(64, 0x00)
secret.write('de66bd178d5abc9e848787b678f9b613')

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lagden
Comment options

Answer selected by lagden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants