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(methods): Implement AddTorrentFromMemory #10

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

KyleSanderson
Copy link
Collaborator

No description provided.

http.go Outdated
Comment on lines 131 to 138
torName := func() string {
z := []byte{'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '_'}
s := make([]byte, 16)
for i := 0; i < len(s); i++ {
s[i] = z[rand.Intn(len(z)-1)]
}

return string(s)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's going on here? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there's a name it uses for the file when it's added. We don't know if it has to be "unique" or not in the future so I wrote this dumb character generator. Can probably remove it, or take a name param.

Copy link
Contributor

Choose a reason for hiding this comment

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

Move it outside to a separate function and give it some proper comments about what it does.

@KyleSanderson KyleSanderson merged commit ce17f8d into main Dec 15, 2023
1 check passed
@KyleSanderson KyleSanderson deleted the feat/mic-like-a-memory branch December 15, 2023 20:17
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.

2 participants