refactor nonce generation and remove base64url padding from value