Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(north setting): the default value of clientID is set to neuron_{random strings of 6 lengths}(#552) #540

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

orangegzx
Copy link
Contributor

@orangegzx orangegzx added the enhancement New feature or request label Aug 15, 2023
@orangegzx orangegzx added this to the 2.6.0 milestone Aug 15, 2023
Comment on lines +229 to +243
export const randomString = (stringLen: number): string => {
// If no parameter, a 1 length string will be generated by default
const len = stringLen || 1

const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
const charactersLen = characters.length
let str = ''

for (let i = 0; i < len; i += 1) {
const randomIndex = Math.floor(Math.random() * charactersLen)
str += characters.charAt(randomIndex)
}

return str
}
Copy link
Member

@ysfscream ysfscream Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here:

export default (): string => {
  return `neuron_${Math.random().toString(16).substr(2, 6)}` as string
}

@ysfscream ysfscream merged commit 6922a2e into v2.6 Aug 16, 2023
1 check passed
@ysfscream ysfscream deleted the feat/v2.6/setting-mqtt branch August 16, 2023 02:16
@orangegzx orangegzx changed the title Feat(north setting): the default value of clientID is set to neuron_ {random strings of 6 lengths} Feat(north setting): the default value of clientID is set to neuron_{random strings of 6 lengths} Aug 22, 2023
@orangegzx orangegzx changed the title Feat(north setting): the default value of clientID is set to neuron_{random strings of 6 lengths} Feat(north setting): the default value of clientID is set to neuron_{random strings of 6 lengths}(#552) Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants