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

Support scrambling #15

Closed
peterp opened this issue May 23, 2022 · 5 comments
Closed

Support scrambling #15

peterp opened this issue May 23, 2022 · 5 comments
Assignees

Comments

@peterp
Copy link
Member

peterp commented May 23, 2022

I think of scrambling as a generic method for non-specific transformations. The idea is that a given string is randomly shifted:

the DOG ate the cheese! becomes shx SAS weq sss snmwlx. I would love to be able to specify characters that should not be transformed:

copycat.scramble(input, { preserve: ['@', ' ', '!'] })

@peterp
Copy link
Member Author

peterp commented May 23, 2022

A person may want to use this is they need to preserve the visual weight, or layout of textual content.

@justinvdm
Copy link
Contributor

copycat.scramble(input, { preserve: ['@', ' ', '!'] })

I really like this API!

@aitorllj93
Copy link

would be possible to use word dictionary instead of just a random string?

@justinvdm
Copy link
Contributor

would be possible to use word dictionary instead of just a random string?

Hey @d3v0ps, do you mean for scrambling specifically? Or more generally?

You can do something like this for now:

import { copycat, faker } from 'copycat'

copycat.oneOf('some-input-value', faker.locales.en.word.noun)
// => 'infrastructure'

Would that work in your use case?

@justinvdm justinvdm assigned justinvdm and unassigned justinvdm Jun 21, 2022
@justinvdm justinvdm self-assigned this Jul 14, 2022
@justinvdm
Copy link
Contributor

Added in #18!

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

No branches or pull requests

3 participants