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

fix: added random id to logos #20

Closed
wants to merge 1 commit into from
Closed

Conversation

Nuzhy-Deriv
Copy link
Contributor

Draft PR to test the random ID

Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3e9ea01
Status: ✅  Deploy successful!
Preview URL: https://c797fab6.quill-icons.pages.dev
Branch Preview URL: https://nuzhy-test-logos.quill-icons.pages.dev

View logs

@shayan-deriv shayan-deriv linked an issue Jan 5, 2024 that may be closed by this pull request
@@ -70,8 +70,18 @@ export const LogosSvgReactOutPutConfig: Options = {
},
},
},
{
name: 'prefixIds',
params: { prefix: Math.random().toString(16) },

Choose a reason for hiding this comment

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

Let's use Nodejs Crypto for this.what do you think?

Choose a reason for hiding this comment

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

there might be a chance that this will generate duplicated strings

Choose a reason for hiding this comment

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


import crypto from 'crypto'
const hash = crypto.randomBytes(16).toString('hex')

Copy link
Contributor

Choose a reason for hiding this comment

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

This approach doesn't help us fixing the ids issue:
svg/svgo#674 (comment)

@Nuzhy-Deriv Nuzhy-Deriv closed this Jan 9, 2024
@Nuzhy-Deriv Nuzhy-Deriv deleted the nuzhy/test-logos branch January 9, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate a unique Id for each SVG
3 participants