-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Use single shared random string generation function #15741
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Replace 3 functions that do the same with 1 shared one - Use crypto/rand over math/rand for a stronger RNG - Output only alphanumerical for URL compatibilty Fixes: #15536
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,12 +13,17 @@ import ( | |
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func Test_RandomImage(t *testing.T) { | ||
| _, err := RandomImage([]byte("gogs@local")) | ||
| func Test_RandomImageSize(t *testing.T) { | ||
| _, err := RandomImageSize(0, []byte("gitea@local")) | ||
| assert.Error(t, err) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. which error ?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That an image of size 0 is invalid. It returns a chinese error currently coming from https://github.com/issue9/identicon: |
||
|
|
||
| _, err = RandomImageSize(64, []byte("gitea@local")) | ||
| assert.NoError(t, err) | ||
| } | ||
|
|
||
| _, err = RandomImageSize(0, []byte("gogs@local")) | ||
| assert.Error(t, err) | ||
| func Test_RandomImage(t *testing.T) { | ||
| _, err := RandomImage([]byte("gitea@local")) | ||
| assert.NoError(t, err) | ||
| } | ||
|
|
||
| func Test_PrepareWithPNG(t *testing.T) { | ||
|
|
||
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.